]> asedeno.scripts.mit.edu Git - linux.git/commit
leds: Allow to call led_classdev_unregister() unconditionally
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 16 Aug 2019 10:52:29 +0000 (13:52 +0300)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Mon, 26 Aug 2019 18:03:58 +0000 (20:03 +0200)
commit1dbb9fb4082ce2a2f1cf9596881ddece062d15d0
tree855d05e70b8bcd092c16fd1f82a1e6bd6bbe4b7b
parent517ea49a7b23c6730ed1a23f152fcd32173eb300
leds: Allow to call led_classdev_unregister() unconditionally

If in the certain driver the LED is optional, and it's a majority of them,
the call of led_classdev_unregister() still requires some additional
checks.

The usual pattern on unregistering is to check for NULL, but we also check
for IS_ERR() in case device_create_with_groups() fails.

The change will reduce a burden in a lot of drivers to repeatedly check
for above conditions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/led-class.c