1 --- a/drivers/net/phy/mdio_bus.c
2 +++ b/drivers/net/phy/mdio_bus.c
3 @@ -274,6 +274,9 @@ static int mdio_bus_match(struct device
4 struct phy_device *phydev = to_phy_device(dev);
5 struct phy_driver *phydrv = to_phy_driver(drv);
8 + return (phydrv->detect(phydev->bus, phydev->addr));
10 return ((phydrv->phy_id & phydrv->phy_id_mask) ==
11 (phydev->phy_id & phydrv->phy_id_mask));
13 --- a/include/linux/phy.h
14 +++ b/include/linux/phy.h
15 @@ -356,6 +356,11 @@ struct phy_driver {
19 + /* Called during discovery to test if the
20 + * device can attach to the bus, even if
21 + * phy id and mask do not match */
22 + bool (*detect)(struct mii_bus *bus, int addr);
25 * Called to initialize the PHY,
26 * including after a reset