On Fri, Feb 13, 2026 at 10:31 AM Tzung-Bi Shih <[email protected]> wrote:
>
> Ensure struct gpio_chip for gpiochip_setup_dev().  This eliminates a few
> checks for struct gpio_chip.
>
> Signed-off-by: Tzung-Bi Shih <[email protected]>
> ---
>
> -int gpiochip_sysfs_register(struct gpio_device *gdev)
> +int gpiochip_sysfs_register(struct gpio_chip *chip)
>  {
> +       struct gpio_device *gdev = chip->gpiodev;
>         struct gpiodev_data *data;
> -       struct gpio_chip *chip;
>         struct device *parent;
>         int err;
>
> @@ -994,12 +994,6 @@ int gpiochip_sysfs_register(struct gpio_device *gdev)
>         if (!class_is_registered(&gpio_class))
>                 return 0;
>
> -       guard(srcu)(&gdev->srcu);
> -
> -       chip = srcu_dereference(gdev->chip, &gdev->srcu);
> -       if (!chip)
> -               return -ENODEV;

I think it would make sense to add lockdep checks when removing guards
in non-static functions.

Bart

Reply via email to