mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-24 04:34:22 +08:00
net: macb: let miiphy_read/_write pass arbitrary addresses
This allows passing arbitrary addresses through macb_miiphy_read and macb_miiphy_write, therefore enabling the mii command to access all mdio bus devices instead of only the defined phy. Signed-off-by: Josef Holzmayr <holzmayr@rsi-elektrotechnik.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
0d3044c210
commit
7c56408be6
@ -241,11 +241,8 @@ int macb_miiphy_read(struct mii_dev *bus, int phy_adr, int devad, int reg)
|
||||
struct macb_device *macb = to_macb(dev);
|
||||
#endif
|
||||
|
||||
if (macb->phy_addr != phy_adr)
|
||||
return -1;
|
||||
|
||||
arch_get_mdio_control(bus->name);
|
||||
value = macb_mdio_read(macb, macb->phy_addr, reg);
|
||||
value = macb_mdio_read(macb, phy_adr, reg);
|
||||
|
||||
return value;
|
||||
}
|
||||
@ -261,11 +258,8 @@ int macb_miiphy_write(struct mii_dev *bus, int phy_adr, int devad, int reg,
|
||||
struct macb_device *macb = to_macb(dev);
|
||||
#endif
|
||||
|
||||
if (macb->phy_addr != phy_adr)
|
||||
return -1;
|
||||
|
||||
arch_get_mdio_control(bus->name);
|
||||
macb_mdio_write(macb, macb->phy_addr, reg, value);
|
||||
macb_mdio_write(macb, phy_adr, reg, value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user