net: bcmgenet: Determine PHY type before scanning MDIO bus
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 16 Jul 2015 22:51:17 +0000 (15:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2015 03:48:14 +0000 (20:48 -0700)
commitc624f89121020882b3db0a33cac8daf151d2930f
tree42d4c0a8fbdac15a6389a448f930cf4ddfa10c9f
parentbd4060a6108befd1110a4c6be5544c932895d18d
net: bcmgenet: Determine PHY type before scanning MDIO bus

Our internal GPHY might be powered off before we attempt scanning the
MDIO bus and bind a driver to it. The way we are currently determining
whether a PHY is internal or not is done *after* we have successfully
matched its driver. If the PHY is powered down, it will not respond to
the MDIO bus, so we will not be able to bind a driver to it.

Our Device Tree for GENET interfaces specifies a "phy-mode" value:
"internal" which tells if this internal uses an internal PHY or not.

If of_get_phy_mode() fails to parse the 'phy-mode' property, do an
additional manual lookup, and if we find "internal" set the
corresponding internal variable accordingly.

Replace all uses of phy_is_internal() with a check against
priv->internal_phy to avoid having to rely on whether or not
priv->phydev is set correctly.

Fixes: 1c1008c793fa4 ("net: bcmgenet: add main driver file")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c
drivers/net/ethernet/broadcom/genet/bcmgenet.h
drivers/net/ethernet/broadcom/genet/bcmmii.c
This page took 0.026731 seconds and 5 git commands to generate.