Skip to content

Commit c64964e

Browse files
henning-schildlag-linaro
authored andcommitted
leds: simatic-ipc-leds-gpio: Make sure we have the GPIO providing driver
If we register a "leds-gpio" platform device for GPIO pins that do not exist we get a -EPROBE_DEFER and the probe will be tried again later. If there is no driver to provide that pin we will poll forever and also create a lot of log messages. So check if that GPIO driver is configured, if so it will come up eventually. If not, we exit our probe function early and do not even bother registering the "leds-gpio". This method was chosen over "Kconfig depends" since this way we can add support for more devices and GPIO backends more easily without "depends":ing on all GPIO backends. Fixes: a6c80be ("leds: simatic-ipc-leds-gpio: Add GPIO version of Siemens driver") Signed-off-by: Henning Schild <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8f47707 commit c64964e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/leds/simple/simatic-ipc-leds-gpio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev)
7777

7878
switch (plat->devmode) {
7979
case SIMATIC_IPC_DEVICE_127E:
80+
if (!IS_ENABLED(CONFIG_PINCTRL_BROXTON))
81+
return -ENODEV;
8082
simatic_ipc_led_gpio_table = &simatic_ipc_led_gpio_table_127e;
8183
break;
8284
case SIMATIC_IPC_DEVICE_227G:

0 commit comments

Comments
 (0)