diff options
author | Arnd Bergmann <arnd@arndb.de> | 2024-01-09 12:06:40 +0300 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-03-07 11:48:03 +0300 |
commit | 09e3f3244e8480d53873bb86a3808edaa3f4e314 (patch) | |
tree | fdae56f8bfc15869ee1a81f8ca17f7c404f032c0 /drivers/staging | |
parent | 211f8ec9400b58fb97cf4b6bd7033781e889bf53 (diff) | |
download | linux-09e3f3244e8480d53873bb86a3808edaa3f4e314.tar.xz |
leds: Make flash and multicolor dependencies unconditional
Along the same lines as making devm_led_classdev_register() declared
extern unconditional, do the same thing for the two sub-classes
that have similar stubs.
The users of these interfaces go to great lengths to allow building
with both the generic leds API and the extended version, but realistically
there is not much use in this, so just simplify it to always rely
on it and remove the confusing fallback logic.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240109090715.982332-2-arnd@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/greybus/Kconfig | 2 | ||||
-rw-r--r-- | drivers/staging/greybus/light.c | 21 |
2 files changed, 1 insertions, 22 deletions
diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig index 927cfa4bc989..1e745a8d439c 100644 --- a/drivers/staging/greybus/Kconfig +++ b/drivers/staging/greybus/Kconfig @@ -64,7 +64,7 @@ config GREYBUS_HID config GREYBUS_LIGHT tristate "Greybus LED Class driver" - depends on LEDS_CLASS + depends on LEDS_CLASS_FLASH help Select this option if you have a device that follows the Greybus LED Class specification. diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 87d36948c610..d62f97249aca 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -29,13 +29,9 @@ struct gb_channel { struct attribute_group *attr_group; const struct attribute_group **attr_groups; struct led_classdev *led; -#if IS_REACHABLE(CONFIG_LEDS_CLASS_FLASH) struct led_classdev_flash fled; struct led_flash_setting intensity_uA; struct led_flash_setting timeout_us; -#else - struct led_classdev cled; -#endif struct gb_light *light; bool is_registered; bool releasing; @@ -84,7 +80,6 @@ static bool is_channel_flash(struct gb_channel *channel) | GB_CHANNEL_MODE_INDICATOR)); } -#if IS_REACHABLE(CONFIG_LEDS_CLASS_FLASH) static struct gb_channel *get_channel_from_cdev(struct led_classdev *cdev) { struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(cdev); @@ -153,22 +148,6 @@ static int __gb_lights_flash_brightness_set(struct gb_channel *channel) return __gb_lights_flash_intensity_set(channel, intensity); } -#else -static struct gb_channel *get_channel_from_cdev(struct led_classdev *cdev) -{ - return container_of(cdev, struct gb_channel, cled); -} - -static struct led_classdev *get_channel_cdev(struct gb_channel *channel) -{ - return &channel->cled; -} - -static int __gb_lights_flash_brightness_set(struct gb_channel *channel) -{ - return 0; -} -#endif static int gb_lights_color_set(struct gb_channel *channel, u32 color); static int gb_lights_fade_set(struct gb_channel *channel); |