aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2019-02-11 18:34:38 +0100
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2019-03-05 13:19:43 +0100
commitd3506d1bc160e4ce2833dff357f2a4b219772c77 (patch)
tree4467a441c7c600c81273f005a146a287485886ff /target
parent1cfbf95393decf047900e1b66b076a030704db20 (diff)
downloadupstream-d3506d1bc160e4ce2833dff357f2a4b219772c77.tar.gz
upstream-d3506d1bc160e4ce2833dff357f2a4b219772c77.tar.bz2
upstream-d3506d1bc160e4ce2833dff357f2a4b219772c77.zip
ar71xx: ag71xx: fix compile error when enabling debug
Starting from kernel 4.5, phy_id needs to be fetched from a different location. not doing so results in this compile error: drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c: In function 'ag71xx_phy_connect_multi': drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c:133:35: error: 'struct mdio_device' has no member named 'phy_id' ag->mii_bus->mdio_map[phy_addr]->phy_id); ^ ./include/linux/printk.h:137:18: note: in definition of macro 'no_printk' printk(fmt, ##__VA_ARGS__); \ ^~~~~~~~~~~ drivers/net/ethernet/atheros/ag71xx/ag71xx.h:72:27: note: in expansion of macro 'pr_debug' #define DBG(fmt, args...) pr_debug(fmt, ## args) ^~~~~~~~ drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c:130:3: note: in expansion of macro 'DBG' DBG("%s: PHY found at %s, uid=%08x\n", ^~~ scripts/Makefile.build:326: recipe for target 'drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.o' failed Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c11
1 files changed, 5 insertions, 6 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..e92798ceb8 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
@@ -127,13 +127,12 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
if (ag->mii_bus->mdio_map[phy_addr] == NULL)
continue;
- 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);
+ phydev = mdiobus_get_phy(ag->mii_bus, phy_addr);
- if (phydev == NULL)
- phydev = mdiobus_get_phy(ag->mii_bus, phy_addr);
+ DBG("%s: PHY found at %s, uid=%08x\n",
+ dev_name(dev),
+ dev_name(&ag->mii_bus->mdio_map[phy_addr]->dev),
+ (phydev) ? phydev->phy_id : 0);
#endif
}