mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
net: phy: fixed: let fixed_phy_add always use addr 0 and remove return value
We have only two users of fixed_phy_add(), both use address 0 and ignore the return value. So simplify fixed_phy_add() accordingly. Whilst at it, constify the fixed_phy_status configs. Note: fixed_phy_add() is a legacy function which shouldn't be used in new code, as it's use may be problematic: - No check whether a fixed phy exists already at the given address - If fixed_phy_register() is called afterwards by any other driver, then it will also use phy_addr 0, because fixed_phy_add() ignores the ida which manages address assignment Drivers using a fixed phy created by fixed_phy_add() in platform code, should dynamically create a fixed phy with fixed_phy_register() instead. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://patch.msgid.link/762700e5-a0b1-41af-aa03-929822a39475@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
7e484a97f6
commit
39e94fdce4
@@ -256,7 +256,7 @@ static int __init bcm47xx_cpu_fixes(void)
|
||||
}
|
||||
arch_initcall(bcm47xx_cpu_fixes);
|
||||
|
||||
static struct fixed_phy_status bcm47xx_fixed_phy_status __initdata = {
|
||||
static const struct fixed_phy_status bcm47xx_fixed_phy_status __initconst = {
|
||||
.link = 1,
|
||||
.speed = SPEED_100,
|
||||
.duplex = DUPLEX_FULL,
|
||||
@@ -282,7 +282,7 @@ static int __init bcm47xx_register_bus_complete(void)
|
||||
bcm47xx_leds_register();
|
||||
bcm47xx_workarounds();
|
||||
|
||||
fixed_phy_add(0, &bcm47xx_fixed_phy_status);
|
||||
fixed_phy_add(&bcm47xx_fixed_phy_status);
|
||||
return 0;
|
||||
}
|
||||
device_initcall(bcm47xx_register_bus_complete);
|
||||
|
||||
Reference in New Issue
Block a user