Skip to content

Commit d43e85b

Browse files
arndbgclement
authored andcommitted
ARM: orion5x: only call into phylib when available
Board code cannot call mdiobus_register_board_info() when phylib or mdio_device is a loadable module: arch/arm/plat-orion/common.o: In function `orion_ge00_switch_init': :(.init.text+0x474): undefined reference to `mdiobus_register_board_info' I had a number of ideas for how this could be solved, but after the MDIO code got split out from PHYLIB it has gotten too hard, so I'm basically giving up, and only call the mdiobus_register_board_info() function if the MDIO layer is built-in to avoid the link error. This is similar to how we handle PHY registration on other ARM platforms. Fixes: 90eff90 ("net: phy: Allow splitting MDIO bus/device support from PHYs") Fixes: 648ea01 ("net: phy: Allow pre-declaration of MDIO devices") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
1 parent c1ae3cf commit d43e85b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

arch/arm/mach-orion5x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ menuconfig ARCH_ORION5X
66
select GPIOLIB
77
select MVEBU_MBUS
88
select PCI
9+
select PHYLIB if NETDEVICES
910
select PLAT_ORION_LEGACY
1011
help
1112
Support for the following Marvell Orion 5x series SoCs:

arch/arm/plat-orion/common.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
468468
eth_data, &orion_ge11);
469469
}
470470

471+
#ifdef CONFIG_ARCH_ORION5X
471472
/*****************************************************************************
472473
* Ethernet switch
473474
****************************************************************************/
@@ -480,6 +481,9 @@ void __init orion_ge00_switch_init(struct dsa_chip_data *d)
480481
struct mdio_board_info *bd;
481482
unsigned int i;
482483

484+
if (!IS_BUILTIN(CONFIG_PHYLIB))
485+
return;
486+
483487
for (i = 0; i < ARRAY_SIZE(d->port_names); i++)
484488
if (!strcmp(d->port_names[i], "cpu"))
485489
break;
@@ -493,6 +497,7 @@ void __init orion_ge00_switch_init(struct dsa_chip_data *d)
493497

494498
mdiobus_register_board_info(&orion_ge00_switch_board_info, 1);
495499
}
500+
#endif
496501

497502
/*****************************************************************************
498503
* I2C

0 commit comments

Comments
 (0)