summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2016-11-01 10:48:32 +1300
committerJoe Hershberger <joe.hershberger@ni.com>2016-11-07 11:28:16 -0600
commit6ecf9e21b5ecd5ddfe9100cb1023ca244fe63ceb (patch)
tree14db6dff7fd0ed90a0c8651e1d1510d18c49bd9e /drivers/net
parentf018545ef756c4bc567d1bbf153615833bc590b0 (diff)
downloadu-boot-6ecf9e21b5ecd5ddfe9100cb1023ca244fe63ceb.tar.gz
u-boot-6ecf9e21b5ecd5ddfe9100cb1023ca244fe63ceb.tar.xz
u-boot-6ecf9e21b5ecd5ddfe9100cb1023ca244fe63ceb.zip
net: mvgbe: Fix build error with CONFIG_PHYLIB
Commit 5a49f17481bb ("net: mii: Use spatch to update miiphy_register") updated the mvgbe implementation of smi_reg_read/smi_reg_write. Prior to that change mvgbe_phy_read and mvgbe_phy_write where used as wrappers to satisfy the phylib APIs. Because these functions weren't updated in that commit build errors where triggered when CONFIG_PHYLIB was enabled. Fix these build errors by removing mvgbe_phy_read and mvgbe_phy_write and using smi_reg_read/smi_reg_write directly. Signed-off-by: Chris Packham <judge.packham@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/mvgbe.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
index c784cdcae2..f833efbe67 100644
--- a/drivers/net/mvgbe.c
+++ b/drivers/net/mvgbe.c
@@ -177,25 +177,6 @@ static int smi_reg_write(struct mii_dev *bus, int phy_adr, int devad,
}
#endif
-#if defined(CONFIG_PHYLIB)
-int mvgbe_phy_read(struct mii_dev *bus, int phy_addr, int dev_addr,
- int reg_addr)
-{
- u16 data;
- int ret;
- ret = smi_reg_read(bus->name, phy_addr, reg_addr, &data);
- if (ret)
- return ret;
- return data;
-}
-
-int mvgbe_phy_write(struct mii_dev *bus, int phy_addr, int dev_addr,
- int reg_addr, u16 data)
-{
- return smi_reg_write(bus->name, phy_addr, reg_addr, data);
-}
-#endif
-
/* Stop and checks all queues */
static void stop_queue(u32 * qreg)
{
@@ -676,8 +657,8 @@ int mvgbe_phylib_init(struct eth_device *dev, int phyid)
printf("mdio_alloc failed\n");
return -ENOMEM;
}
- bus->read = mvgbe_phy_read;
- bus->write = mvgbe_phy_write;
+ bus->read = smi_reg_read;
+ bus->write = smi_reg_write;
strcpy(bus->name, dev->name);
ret = mdio_register(bus);
@@ -688,7 +669,7 @@ int mvgbe_phylib_init(struct eth_device *dev, int phyid)
}
/* Set phy address of the port */
- mvgbe_phy_write(bus, MV_PHY_ADR_REQUEST, 0, MV_PHY_ADR_REQUEST, phyid);
+ smi_reg_write(bus, MV_PHY_ADR_REQUEST, 0, MV_PHY_ADR_REQUEST, phyid);
phydev = phy_connect(bus, phyid, dev, PHY_INTERFACE_MODE_RGMII);
if (!phydev) {