diff options
author | Daniel F. Dickinson <cshored@thecshore.com> | 2018-07-25 19:14:26 -0400 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-07-30 10:43:35 +0200 |
commit | 2655fbe8efb2a596aa8db92cffa817e3bf0c64ea (patch) | |
tree | 314cd9a343fb7b40f65241156261442198d736b1 | |
parent | 0a492ee39e1c1a226dc34923909459117077b4c5 (diff) | |
download | upstream-2655fbe8efb2a596aa8db92cffa817e3bf0c64ea.tar.gz upstream-2655fbe8efb2a596aa8db92cffa817e3bf0c64ea.tar.bz2 upstream-2655fbe8efb2a596aa8db92cffa817e3bf0c64ea.zip |
ar71xx: ag71xx_phy: Fix compilation for debug messages
NB: Error only appears with ag71xx debug messages and dynamic printk
enabled. This is probably why no one has caught it before.
Previously phy probe debug messages used old (now wrong) functions
to get the phy name for printing. There was also the chance of
a NULL pointer in the event no phy_device was found.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
-rw-r--r-- | target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c index 12fa2e301b..223340341f 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c @@ -119,7 +119,8 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag) DBG("%s: PHY found at %s, uid=%08x\n", dev_name(dev), dev_name(&ag->mii_bus->phy_map[phy_addr]->dev), - ag->mii_bus->phy_map[phy_addr]->phy_id); + &ag->mii_bus->phy_map[phy_addr]->phy_id), + &ag->mii_bus->phy_map[phy_addr]->phy_id : 0); if (phydev == NULL) phydev = ag->mii_bus->phy_map[phy_addr]; @@ -130,7 +131,8 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag) DBG("%s: PHY found at %s, uid=%08x\n", dev_name(dev), dev_name(&ag->mii_bus->mdio_map[phy_addr]->dev), - ag->mii_bus->mdio_map[phy_addr]->phy_id); + mdiobus_get_phy(ag->mii_bus, phy_addr) ? + mdiobus_get_phy(ag->mii_bus, phy_addr)->phy_id : 0); if (phydev == NULL) phydev = mdiobus_get_phy(ag->mii_bus, phy_addr); |