Skip to content

Commit 8650b60

Browse files
sulixlinusw
authored andcommitted
gpio: of: Build fails if CONFIG_OF_DYNAMIC enabled without CONFIG_OF_GPIO
The symbol 'gpio_of_notifier' doesn't exist without both CONFIG_OF_GPIO and CONFIG_OF_DYNAMIC enabled, but is referenced when only CONFIG_OF_DYNAMIC is enabled. This broke building with 'make ARCH=um allyesconfig': --------------- /usr/bin/ld: drivers/gpio/gpiolib.o: in function `gpiolib_dev_init': ./drivers/gpio/gpiolib.c:5293: undefined reference to `gpio_of_notifier' collect2: error: ld returned 1 exit status --------------- Fixes: 63636d9 ("gpio: of: Add DT overlay support for GPIO hogs") Signed-off-by: David Gow <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 8312d50 commit 8650b60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpio/gpiolib.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5312,8 +5312,9 @@ static int __init gpiolib_dev_init(void)
53125312
gpiolib_initialized = true;
53135313
gpiochip_setup_devs();
53145314

5315-
if (IS_ENABLED(CONFIG_OF_DYNAMIC))
5316-
WARN_ON(of_reconfig_notifier_register(&gpio_of_notifier));
5315+
#if IS_ENABLED(CONFIG_OF_DYNAMIC) && IS_ENABLED(CONFIG_OF_GPIO)
5316+
WARN_ON(of_reconfig_notifier_register(&gpio_of_notifier));
5317+
#endif /* CONFIG_OF_DYNAMIC && CONFIG_OF_GPIO */
53175318

53185319
return ret;
53195320
}

0 commit comments

Comments
 (0)