net: macb: fix probing of PHY not described in the dt
authorAntoine Tenart <antoine.tenart@bootlin.com>
Tue, 17 Dec 2019 17:07:42 +0000 (18:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Dec 2019 01:32:21 +0000 (17:32 -0800)
commitef8a2e27289ee1b24e743c4302a053b128e16284
tree99e7e6395c533583a6f29195119ec350ab96dd85
parent0aa4d016c043d16a282e7e93edf6213a7b954c90
net: macb: fix probing of PHY not described in the dt

This patch fixes the case where the PHY isn't described in the device
tree. This is due to the way the MDIO bus is registered in the driver:
whether the PHY is described in the device tree or not, the bus is
registered through of_mdiobus_register. The function masks all the PHYs
and only allow probing the ones described in the device tree. Prior to
the Phylink conversion this was also done but later on in the driver
the MDIO bus was manually scanned to circumvent the fact that the PHY
wasn't described.

This patch fixes it in a proper way, by registering the MDIO bus based
on if the PHY attached to a given interface is described in the device
tree or not.

Fixes: 7897b071ac3b ("net: macb: convert to phylink")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c