net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 14 Jul 2017 06:53:57 +0000 (08:53 +0200)
committerStefano Babic <sbabic@denx.de>
Fri, 28 Jul 2017 11:41:49 +0000 (13:41 +0200)
commit 306dd7dabd64 ("net: fec_mxc: fix PHY initialization bug with CONFIG_DM_ETH")
has broken the build of the fec_mxc driver with CONFIG_DM_ETH
enabled because it changed the parameters passed to *fec_get_miibus()
without changing the functions prototype.

This patch fixes up the prototype of fec_get_miibus() for the DM_ETH case.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
drivers/net/fec_mxc.c
include/netdev.h

index 40be52070eae9c0dfa6e7537d163c6eed34cfa86..dc7b5127ebdba7f9003ecb4c648e306055b19ae2 100644 (file)
@@ -985,9 +985,18 @@ static void fec_free_descs(struct fec_priv *fec)
        free(fec->tbd_base);
 }
 
+#ifdef CONFIG_DM_ETH
+struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id)
+#else
 struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id)
+#endif
 {
+#ifdef CONFIG_DM_ETH
+       struct fec_priv *priv = dev_get_priv(dev);
+       struct ethernet_regs *eth = priv->eth;
+#else
        struct ethernet_regs *eth = (struct ethernet_regs *)base_addr;
+#endif
        struct mii_dev *bus;
        int ret;
 
index c06b90886b3da80c0a6a21957cc3e34bf2132fce..b9bfebac67f79d550fa026a2e45d0fe9f090df62 100644 (file)
@@ -130,7 +130,12 @@ static inline int pci_eth_init(bd_t *bis)
        return num;
 }
 
+#ifdef CONFIG_DM_ETH
+struct mii_dev *fec_get_miibus(struct udevice *dev, int dev_id);
+#else
 struct mii_dev *fec_get_miibus(uint32_t base_addr, int dev_id);
+#endif
+
 #ifdef CONFIG_PHYLIB
 struct phy_device;
 int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,