net: of: fix stub of_net helpers for CONFIG_NET=n
authorArnd Bergmann <arnd@arndb.de>
Thu, 14 Oct 2021 09:00:37 +0000 (11:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:42 +0000 (19:12 +0100)
commit9285523b41746110814058f99a940f3edf2b5582
tree7ad63f1e0436e9eb66e7d33981d09a6a81057c40
parentdc75d7968901bc097c4607a70159f9f63d2995ef
net: of: fix stub of_net helpers for CONFIG_NET=n

[ Upstream commit 8b017fbe0bbb98dd71fb4850f6b9cc0e136a26b8 ]

Moving the of_net code from drivers/of/ to net/core means we
no longer stub out the helpers when networking is disabled,
which leads to a randconfig build failure with at least one
ARM platform that calls this from non-networking code:

arm-linux-gnueabi-ld: arch/arm/mach-mvebu/kirkwood.o: in function `kirkwood_dt_eth_fixup':
kirkwood.c:(.init.text+0x54): undefined reference to `of_get_mac_address'

Restore the way this worked before by changing that #ifdef
check back to testing for both CONFIG_OF and CONFIG_NET.

Fixes: e330fb14590c ("of: net: move of_net under net/")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20211014090055.2058949-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/of_net.h