Skip to content

Commit 71f50c6

Browse files
masahir0yrobherring
authored andcommitted
of: drop symbols declared by _OF_DECLARE() from modules
The users of this macro (OF_EARLYCON_DECLARE, CLK_OF_DECLARE, IRQCHIP_DECLARE, etc.) are only parsed in the early boot stage. Such symbols contained in modules are never used. This commit fixes the link error introduced by commit b8d20e0 ("serial: 8250_uniphier: add earlycon support"); the combination of CONFIG_SERIAL_8250_UNIPHIER=m and CONFIG_SERIAL_8250_CONSOLE=y fails to link: ERROR: "early_serial8250_setup" [drivers/tty/serial/8250/8250_uniphier.ko] undefined! Fixes: b8d20e0 ("serial: 8250_uniphier: add earlycon support") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent e68d7c1 commit 71f50c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/of.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ static inline int of_get_available_child_count(const struct device_node *np)
929929
return num;
930930
}
931931

932-
#ifdef CONFIG_OF
932+
#if defined(CONFIG_OF) && !defined(MODULE)
933933
#define _OF_DECLARE(table, name, compat, fn, fn_type) \
934934
static const struct of_device_id __of_table_##name \
935935
__used __section(__##table##_of_table) \

0 commit comments

Comments
 (0)