net: macb: Fix regression breaking non-MDIO fixed-link PHYs
authorAhmad Fatoum <a.fatoum@pengutronix.de>
Tue, 21 Aug 2018 15:35:48 +0000 (17:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Aug 2018 00:30:02 +0000 (17:30 -0700)
commit145e822a6b05340db99466c7be90343455c085d6
treeb0609681db92929a9e0578351375fc4214ba4597
parent34ff33050d920a6d82f2dba1796034abe7512b95
net: macb: Fix regression breaking non-MDIO fixed-link PHYs

commit 97583f8700c3 ("net: macb: Reorganize macb_mii bringup") broke
initializing macb on the EVB-KSZ9477 eval board.
There, of_mdiobus_register was called even for the fixed-link representing
the RGMII-link to the switch with the result that the driver attempts to
enumerate PHYs on a non-existent MDIO bus:

libphy: MACB_mii_bus: probed
mdio_bus f0028000.ethernet-ffffffff: fixed-link has invalid PHY address
mdio_bus f0028000.ethernet-ffffffff: scan phy fixed-link at address 0
        [snip]
mdio_bus f0028000.ethernet-ffffffff: scan phy fixed-link at address 31

The "MDIO" bus registration succeeds regardless, having claimed the reset GPIO,
and calling of_phy_register_fixed_link later on fails because it tries
to claim the same GPIO:

macb f0028000.ethernet: broken fixed-link specification

Fix this by registering the fixed-link before calling mdiobus_register.

Fixes: 97583f8700c3 ("net: macb: Reorganize macb_mii bringup")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c