Re: [PATCH net-next] net: phy: mscc: Add support for PHY LEDs on VSC8541
From: Andrew Lunn
Date: Fri Nov 07 2025 - 08:14:37 EST
> > > @@ -2343,6 +2532,26 @@ static int vsc85xx_probe(struct phy_device *phydev)
> > > if (!vsc8531->stats)
> > > return -ENOMEM;
> > >
> > > + phy_id = phydev->drv->phy_id & phydev->drv->phy_id_mask;
> > > + if (phy_id == PHY_ID_VSC8541) {
> >
> > The VSC8541 has its own probe function, vsc8514_probe(). Why is this
> > needed?
> >
> vsc85xx_probe() is used for other PHYs along with VSC8541 hence this
> check, vsc8514_probe() is for 8514 PHY.
Ah, sorry. I was looking at 8514, not 8541. So yes, this is needed.
However, i think all the current probe functions could do with some
cleanup. There is a lot of repeated code. That could all be moved into
a vsc85xx_probe_common(), and then a vsc8514_probe() added, which uses
this common function to do most of the work, and then handles LEDs.
Also, is the LED handling you are adding here specific to the 8541? If
you look at the datasheets for the other devices, are any the same?
Andrew