From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753477AbdBIPR7 (ORCPT ); Thu, 9 Feb 2017 10:17:59 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:49396 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752857AbdBIPR4 (ORCPT ); Thu, 9 Feb 2017 10:17:56 -0500 From: Arnd Bergmann To: "David S . Miller" Cc: netdev@vger.kernel.org, Arnd Bergmann , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Russell King , Florian Fainelli , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] [net-next] ARM: orion: fix PHYLIB dependency Date: Thu, 9 Feb 2017 16:08:11 +0100 Message-Id: <20170209150834.1158193-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:wBey1lmeM2lCgpKDPezXow4OLeNfBmrlwDEgIz1vt5Dvty0Hn+W 3iH3TxFfNPDhPimR7GEPopAWqE9PxbKKVZvh3C0aKizigq1MsYPxC41FYs+X5Cjh9qinvaY ciSypgJpvF1bmqQm9ogZpGQp3+iQ1+cArNPkOrzeO3doAiYX9uOgaqU2gm3FemJNga/AzjL 2ILXfqHRuoRhR+UOjzMaA== X-UI-Out-Filterresults: notjunk:1;V01:K0:efcLB5P0Zkk=:66hsPCZLq+tm7uiP0y/51C 3yhD7+N0cRKxm1FMc5eLvS40U6IaJjR/7m5DPFWYkpC6s/BaUvHjnIaX4h6cOPL8FraGqUldU euuK/YumUTiGNcU3vd0QuoJaA85l/339ls1NCAevI9vbKrfOkJrbKMJ+d59O4hApO3xnwNDaV /fzWKJcceyKy6PWbYtRlOV6cMqShi0RIDOPmx/SQyRkGaKlWaJyrBKqSik6xsir9WhSymF9Ex AyrboF3B3AM2VEsDBaYgPphrQHPAuxxWH5DeOe/pgxLKFQd2f0CkjgR6OJvDh9F8HPqPnjs3O EAwMrz03V8sDHiOwu4YmyCjdbjxpfkHtcXYuUr9cq92QGJLTavNt8w4qKVRXOh1dgj81gedW6 NRsC9vBNfWNsmGm4R5VLhrdwAxEulcq92EsZexSDetx6JGi0dJvs65lTdG/xNgxh/epJr+sxB c57FkRwnO2ZP9WbNgUByoeKWn7Qbk5zqgj/+XVydEGLfzXRo6kgVjQHsR+4QF902gHTLpBshx xhY2SZMddMwcLHPXnZMsjXaGffLzVsG0K9Y4EItf1kcBBnCsc/cXAgZpiDUOYlK/9jARqAJYx tlD8gPK8+4s+T3ZWtViKjUW2XuHPFZRD047qqxhayf6WQhVqz0r5Onj9Q8pA6m2cyJGNZGHES Ss/X2N7sVQdveVgM07utnbYtNvm0zwlJunjAvjAImo+WYb35M0Nyv/7kqqN1RikVsBp0= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The newly introduced mdiobus_register_board_info() function is only available as part of PHYLIB, so we get a link error when we call that from a board while phylib is disabled: arch/arm/plat-orion/common.o: In function `orion_ge00_switch_init': common.c:(.init.text+0x6a4): undefined reference to `mdiobus_register_board_info' This adds a workaround that is made up of three parts: - in plat-orion, the function for declaring the switch is hidden without PHYLIB. - in mach-orion5x, the caller conditionally stubs out the call to the removed function, so we can still build other orion5x boards without PHYLIB - For the boards that actually declare the switch, we select PHYLIB explicitly from Kconfig if NETDEVICES is set. Without NETDEVICES, we cannot enable PHYLIB, but we also wouldn't need it. Signed-off-by: Arnd Bergmann --- arch/arm/mach-orion5x/Kconfig | 5 +++++ arch/arm/mach-orion5x/common.c | 4 ++-- arch/arm/plat-orion/common.c | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig index 468b8cb7fd5f..b98a0057ef66 100644 --- a/arch/arm/mach-orion5x/Kconfig +++ b/arch/arm/mach-orion5x/Kconfig @@ -107,6 +107,7 @@ config MACH_TS409 config MACH_WRT350N_V2 bool "Linksys WRT350N v2" + select PHYLIB if NETDEVICES help Say 'Y' here if you want your kernel to support the Linksys WRT350N v2 platform. @@ -146,24 +147,28 @@ config MACH_MSS2_DT config MACH_WNR854T bool "Netgear WNR854T" + select PHYLIB if NETDEVICES help Say 'Y' here if you want your kernel to support the Netgear WNR854T platform. config MACH_RD88F5181L_GE bool "Marvell Orion-VoIP GE Reference Design" + select PHYLIB if NETDEVICES help Say 'Y' here if you want your kernel to support the Marvell Orion-VoIP GE (88F5181L) RD. config MACH_RD88F5181L_FXO bool "Marvell Orion-VoIP FXO Reference Design" + select PHYLIB if NETDEVICES help Say 'Y' here if you want your kernel to support the Marvell Orion-VoIP FXO (88F5181L) RD. config MACH_RD88F6183AP_GE bool "Marvell Orion-1-90 AP GE Reference Design" + select PHYLIB if NETDEVICES help Say 'Y' here if you want your kernel to support the Marvell Orion-1-90 (88F6183) AP GE RD. diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index 83a7ec4c16d0..e712c5adaf87 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c @@ -107,10 +107,10 @@ void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data) ****************************************************************************/ void __init orion5x_eth_switch_init(struct dsa_chip_data *d) { - orion_ge00_switch_init(d); + if (IS_BUILTIN(CONFIG_PHYLIB)) + orion_ge00_switch_init(d); } - /***************************************************************************** * I2C ****************************************************************************/ diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index 9255b6d67ba5..ab5af56f9b9d 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c @@ -471,6 +471,7 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, /***************************************************************************** * Ethernet switch ****************************************************************************/ +#if IS_BUILTIN(CONFIG_PHYLIB) static __initconst const char *orion_ge00_mvmdio_bus_name = "orion-mii"; static __initdata struct mdio_board_info orion_ge00_switch_board_info; @@ -493,6 +494,7 @@ void __init orion_ge00_switch_init(struct dsa_chip_data *d) mdiobus_register_board_info(&orion_ge00_switch_board_info, 1); } +#endif /***************************************************************************** * I2C -- 2.9.0