Re: [PATCH v7 4/8] leds: lp3952: use devm API to cleanup module's resources

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 14, 2024 at 10:19 PM George Stark <gnstark@xxxxxxxxxxxxxxxxx> wrote:
>
> In this driver LEDs are registered using devm_led_classdev_register()
> so they are automatically unregistered after module's remove() is done.
> led_classdev_unregister() calls module's led_set_brightness() to turn off
> the LEDs and that callback uses resources which were destroyed already
> in module's remove() so use devm API instead of remove().
> Also drop explicit turning LEDs off from remove() due to they will be off
> anyway by led_classdev_unregister().

...

> +static void gpio_set_low_action(void *data)
> +{
> +       struct lp3952_led_array *priv = (struct lp3952_led_array *)data;

In case of new series, drop these castings in patches 4-6.

> +       gpiod_set_value(priv->enable_gpio, 0);
> +}


-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux