diff mbox

[U-Boot,v2,BUGFIX] net: fec_mxc: adjust prototype of fec_get_miibus() for DM_ETH

Message ID 1500015237-19276-1-git-send-email-LW@KARO-electronics.de
State Accepted
Commit cb5761f774dffeff7cf19d40803613db7089c9af
Delegated to: Stefano Babic
Headers show

Commit Message

Lothar Waßmann July 14, 2017, 6:53 a.m. UTC
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>
---
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(+)

Comments

Stefano Babic July 28, 2017, 11:45 a.m. UTC | #1
Hi Lothar,

On 14/07/2017 08:53, Lothar Waßmann wrote:
> 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>
> ---
> 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(+)
> 
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 4ad4ddc..e42d54b 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -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;
>  
> diff --git a/include/netdev.h b/include/netdev.h
> index c06b908..b9bfeba 100644
> --- a/include/netdev.h
> +++ b/include/netdev.h
> @@ -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,
> 

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

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 4ad4ddc..e42d54b 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -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;
 
diff --git a/include/netdev.h b/include/netdev.h
index c06b908..b9bfeba 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -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,