Skip to content

net: phy: remove fixed_phy_add and first its users

Heiner Kallweit imx linux-m68k linux-mips netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 5 repliesApplied 6/6

Patches in v1 All 6 applied

#Subject and filesSizeRepliesApplied
1/6net: phy: fixed_phy: add helper fixed_phy_register_100fddrivers/net/phy/fixed_phy.c include/linux/phy_fixed.h+18 -00 repliesApplied
2/6net: fec: register a fixed phy using fixed_phy_register_100fd if neededdrivers/net/ethernet/freescale/Kconfig drivers/net/ethernet/freescale/fec_main.c+27 -265 repliesApplied
3/6m68k: coldfire: remove creating a fixed phyarch/m68k/coldfire/m5272.c+0 -150 repliesApplied
4/6net: b44: register a fixed phy using fixed_phy_register_100fd if neededdrivers/net/ethernet/broadcom/Kconfig drivers/net/ethernet/broadcom/b44.c+21 -170 repliesApplied
5/6MIPS: BCM47XX: remove creating a fixed phyarch/mips/bcm47xx/setup.c+0 -70 repliesApplied
6/6net: phy: fixed_phy: remove fixed_phy_adddrivers/net/phy/fixed_phy.c include/linux/phy_fixed.h+0 -80 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/6] net: phy: remove fixed_phy_add and first its users

fixed_phy_add() has a number of problems/disadvantages:
- It uses phy address 0 w/o checking whether a fixed phy with this address exists already.
- A subsequent call to fixed_phy_register() would also use phy address 0, because fixed_phy_add() doesn't mark it as used.
- fixed_phy_add() is used from platform code, therefore requires that fixed phy code is built-in.

fixed_phy_add() has only two users
- coldfire/5272, using fec
- bcm47xx, using b44

So migrate fec and b44 to use fixed_phy_register_100fd(), afterwards remove usage of fixed_phy_add() from the two platforms, and eventually remove fixed_phy_add().

When I proposed helper fixed_phy_register_100fd() first, there was the question whether it's worth it, and Jakub asked to submit the full series:
https://lore.kernel.org/netdev/[email protected]/
Apart from this series, there are two more places where the helper can be used to simplify the code: dsa_loop, ftgmac100
I left this for a follow-up.

Heiner Kallweit (6):
net: phy: fixed_phy: add helper fixed_phy_register_100fd
net: fec: register a fixed phy using fixed_phy_register_100fd if
needed
m68k: coldfire: remove creating a fixed phy
net: b44: register a fixed phy using fixed_phy_register_100fd if
needed
MIPS: BCM47XX: remove creating a fixed phy
net: phy: fixed_phy: remove fixed_phy_add

 arch/m68k/coldfire/m5272.c                | 15 -------
 arch/mips/bcm47xx/setup.c                 |  7 ---
 drivers/net/ethernet/broadcom/Kconfig     |  1 +
 drivers/net/ethernet/broadcom/b44.c       | 37 ++++++++--------
 drivers/net/ethernet/freescale/Kconfig    |  1 +
 drivers/net/ethernet/freescale/fec_main.c | 52 +++++++++++------------
 drivers/net/phy/fixed_phy.c               | 18 +++++---
 include/linux/phy_fixed.h                 |  8 +++-
 8 files changed, 66 insertions(+), 73 deletions(-)
Signature · 1 line
2.51.1