Re: [net-next RFC PATCH v2 2/3] net: phy: Add support for Aeonsemi AS21xxx PHYs

From: Russell King (Oracle)
Date: Wed Mar 26 2025 - 14:33:21 EST


On Wed, Mar 26, 2025 at 07:18:12PM +0100, Christian Marangi wrote:
> On Wed, Mar 26, 2025 at 06:08:09PM +0000, Russell King (Oracle) wrote:
> > An alternative would be to change the match_phy_device() method to
> > pass the phy_driver, which would allow a single match_phy_device
> > function to match the new hardware ID values against the PHY IDs in
> > the phy_driver without needing to modify the IDs in phy_device.
> >
>
> I also considered extending the function with additional stuff but then
> I considered that would mean rework each PHY driver and destroy PHY
> driver downstream, not something we should care but still quite a big
> task. If the -ENODEV path is not OK, I feel an additional OP is better
> than tweaking match_phy_device.

For those in the kernel, 8 files, 26 initialisers.

drivers/net/phy/nxp-c45-tja11xx.c can probably be simplified with
this idea, reducing it down to a pair of functions.

drivers/net/phy/bcm87xx.c can probably be reduced to one match function.

So, doing so would appear to bring benefits to other PHY drivers.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!