Skip to contentSkip to conversation

net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

PATCH New Lothar Waßmann 2 participants 5 messages Jul 13, 2017 – Jul 28, 2017 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

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.

---
 drivers/net/fec_mxc.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/fec_mxc.c +9 -0
index 4ad4ddc..e42d54b 100644
@@ -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;
 
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

Quoted 17 lines · Lothar Waßmann

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.

---
 drivers/net/fec_mxc.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/fec_mxc.c +0 -0
index 4ad4ddc..e42d54b 100644

drivers/net/fec_mxc.c static void fec_free_descs(struct fec_priv *fec) · line 992

Quoted 8 lines
drivers/net/fec_mxc.c +4 -0
@@ -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

Is it enough ? fec_get_miibus prototype is in include/netdev.h.

drivers/net/fec_mxc.c static void fec_free_descs(struct fec_priv *fec) · line 1002

Quoted 11 lines
drivers/net/fec_mxc.c +5 -0
 {
+#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;
 

Best regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#2 lore raw

PATCH 1/1 net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

Hi,

Quoted 21 lines · On Thu, 13 Jul 2017 16:45:00 +0200 Stefano Babic wrote:
Quoted 20 lines · Lothar Waßmann

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.

---
 drivers/net/fec_mxc.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/fec_mxc.c +0 -0
index 4ad4ddc..e42d54b 100644
@@ -985,9 +985,18 @@ static void fec_free_descs(struct fec_priv *fec)
 	free(fec->tbd_base);
 }
 
Quoted 8 lines

drivers/net/fec_mxc.c static void fec_free_descs(struct fec_priv *fec) · line 992

Quoted 5 lines
drivers/net/fec_mxc.c +4 -0
+#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

Is it enough ? fec_get_miibus prototype is in include/netdev.h.

Sorry, I missed the include file when splitting the patch out into another working directory. I'll resend a corrected version.

Lothar Waßmann

#3 lore raw

PATCH v2 1/1 net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

In reply to Stefano Babic

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.

---
Changes vs. v1:
added missing prototype change in netdev.h

 drivers/net/fec_mxc.c | 9 +++++++++
 include/netdev.h      | 5 +++++
 2 files changed, 14 insertions(+)
drivers/net/fec_mxc.c +9 -0
index 4ad4ddc..e42d54b 100644
@@ -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;
 
include/netdev.h +5 -0
index c06b908..b9bfeba 100644
@@ -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,
Signature · 1 line
2.1.4
#4 lore raw

PATCH v2 1/1 net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

Hi Lothar,

Quoted 47 lines · Lothar Waßmann

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.

---
Changes vs. v1:
added missing prototype change in netdev.h

 drivers/net/fec_mxc.c | 9 +++++++++
 include/netdev.h      | 5 +++++
 2 files changed, 14 insertions(+)
drivers/net/fec_mxc.c +9 -0
index 4ad4ddc..e42d54b 100644
@@ -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;
 
include/netdev.h +0 -0
index c06b908..b9bfeba 100644
@@ -130,7 +130,12 @@ static inline int pci_eth_init(bd_t *bis)
 	return num;
 }

include/netdev.h static inline int pci_eth_init(bd_t *bis) · line 141

Quoted 10 lines
include/netdev.h +5 -0
 
+#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,

Applied to u-boot-imx, -master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================