Skip to contentSkip to conversation

leds: rt8515: add V4L2_FLASH_LED_CLASS dependency

PATCH In review Arnd Bergmann 3 participants 4 messages Feb 4, 2021 – Feb 15, 2021 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: rt8515: add V4L2_FLASH_LED_CLASS dependency

From: Arnd Bergmann <[email protected]>

The leds-rt8515 driver can optionall use the v4l2 flash led class, but it causes a link error when that class is in a loadable module and the rt8515 driver itself is built-in:

ld.lld: error: undefined symbol: v4l2_flash_init

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by leds-rt8515.c

              leds/flash/leds-rt8515.o:(rt8515_probe) in archive

drivers/built-in.a

Adding 'depends on V4L2_FLASH_LED_CLASS' in Kconfig would avoid that, but it would make it impossible to use the driver without the v4l2 support.

Add the same dependency that the other users of this class have instead, which just prevents the broken configuration.

Fixes e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver")
---
 drivers/leds/flash/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/leds/flash/Kconfig +1 -0
index d21d273ef3da..b580b416b9a4 100644
@@ -5,6 +5,7 @@ if LEDS_CLASS_FLASH
 config LEDS_RT8515
 	tristate "LED support for Richtek RT8515 flash/torch LED"
 	depends on GPIOLIB
+	depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS
 	help
 	  This option enables support for the Richtek RT8515 flash
 	  and torch LEDs found on some mobile phones.
Signature · 1 line
2.29.2
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The leds-rt8515 driver can optionall use the v4l2 flash led class,

Optionally.

Quoted 5 lines

Add the same dependency that the other users of this class have instead, which just prevents the broken configuration.

Fixes e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver")

Thanks for the fix. If you plan to send a pull request to linus before 5.11, feel free to add it.

Otherwise I'll queue it for -rc1, I guess.

Best regards,
Pavel

Signature · 1 line
http://www.livejournal.com/~pavelmachek
Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 15 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The leds-rt8515 driver can optionall use the v4l2 flash led class, but it causes a link error when that class is in a loadable module and the rt8515 driver itself is built-in:

ld.lld: error: undefined symbol: v4l2_flash_init

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by leds-rt8515.c

              leds/flash/leds-rt8515.o:(rt8515_probe) in archive

drivers/built-in.a

Adding 'depends on V4L2_FLASH_LED_CLASS' in Kconfig would avoid that, but it would make it impossible to use the driver without the v4l2 support.

Quoted 5 lines

Add the same dependency that the other users of this class have instead, which just prevents the broken configuration.

Fixes e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver")
Quoted 1 line

+ depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS

This kind of thing that looks like a truism but isn't is one of the most unintuitive
things about KConfig :/ no idea what to do about it though.

I remember making a program for the C64 in early 1990ies with joke input such as y/n/m (yes/no/maybe), sadly in Kconfig this is no joke.

Yours,
Linus Walleij

#3 lore raw

Hi!

Quoted 21 lines
Quoted 15 lines

From: Arnd Bergmann <[email protected]>

The leds-rt8515 driver can optionall use the v4l2 flash led class, but it causes a link error when that class is in a loadable module and the rt8515 driver itself is built-in:

ld.lld: error: undefined symbol: v4l2_flash_init

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by leds-rt8515.c

              leds/flash/leds-rt8515.o:(rt8515_probe) in archive

drivers/built-in.a

Adding 'depends on V4L2_FLASH_LED_CLASS' in Kconfig would avoid that, but it would make it impossible to use the driver without the v4l2 support.

Quoted 5 lines

Add the same dependency that the other users of this class have instead, which just prevents the broken configuration.

Fixes e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver")
Quoted 7 lines
Quoted 1 line

+ depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS

This kind of thing that looks like a truism but isn't is one of the most unintuitive
things about KConfig :/ no idea what to do about it though.

This is the way it is usually fixed. Anyway, I applied it and pushed it to Linus and it is now merged.

Quoted 2 lines

I remember making a program for the C64 in early 1990ies with joke input such as y/n/m (yes/no/maybe), sadly in Kconfig this is no joke.

:-).

Best regards,
Pavel

Signature · 1 line
http://www.livejournal.com/~pavelmachek