Re: [net-next RFC PATCH v4 1/6] net: phy: pass PHY driver to .match_phy_device OP

From: Christian Marangi
Date: Fri Mar 28 2025 - 04:31:55 EST


On Fri, Mar 28, 2025 at 08:24:44AM +0000, Russell King (Oracle) wrote:
> On Thu, Mar 27, 2025 at 11:45:12PM +0100, Christian Marangi wrote:
> > Pass PHY driver pointer to .match_phy_device OP in addition to phydev.
> > Having access to the PHY driver struct might be useful to check the
> > PHY ID of the driver is being matched for in case the PHY ID scanned in
> > the phydev is not consistent.
> >
> > A scenario for this is a PHY that change PHY ID after a firmware is
> > loaded, in such case, the PHY ID stored in PHY device struct is not
> > valid anymore and PHY will manually scan the ID in the match_phy_device
> > function.
> >
> > Having the PHY driver info is also useful for those PHY driver that
> > implement multiple simple .match_phy_device OP to match specific MMD PHY
> > ID. With this extra info if the parsing logic is the same, the matching
> > function can be generalized by using the phy_id in the PHY driver
> > instead of hardcoding.
> >
> > Suggested-by: Reviewed-by: Russell King (Oracle) <rmk+kernel@xxxxxxxxxxxxxxx>
>
> Too much copy'n'pasting?
>

Nono it's me creating new Tag type. Also planned to use Suggested-by:
Reviewed-by: Signed-off-by in one line. :D (joking... hope everything
else is ok so v5 will have everything with tag)

--
Ansuel