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)
commitab5f11055fdf8dfc3ddbd89e8e3cc550de41d1d3
treeb0609681db92929a9e0578351375fc4214ba4597
parent602b74eda81311dbdb5dbab08c30f789f648ebdc
net: macb: Fix regression breaking non-MDIO fixed-link PHYs

commit 739de9a1563a ("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: 739de9a1563a ("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