leds: spi-byte: Use devm_mutex_init() for mutex initialization
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 6 Jun 2024 17:29:22 +0000 (20:29 +0300)
committerLee Jones <lee@kernel.org>
Wed, 26 Jun 2024 15:56:06 +0000 (16:56 +0100)
commit133f941f2239cbf8bd4b8a9c112e4811215149bf
tree747893c5f162a83349def288911f29cb3aef7852
parent9ed388d1acb9b8d1136f429573d14ade963ba727
leds: spi-byte: Use devm_mutex_init() for mutex initialization

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 mutex which was destroyed already
in module's remove() so use devm API instead.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240606173037.3091598-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/leds-spi-byte.c