diff mbox

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

Message ID 1499925424-22905-1-git-send-email-LW@KARO-electronics.de
State Superseded
Headers show

Commit Message

Lothar Waßmann July 13, 2017, 5:57 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>
---
 drivers/net/fec_mxc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Stefano Babic July 13, 2017, 2:45 p.m. UTC | #1
On 13/07/2017 07:57, 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>
> ---
>  drivers/net/fec_mxc.c | 9 +++++++++
>  1 file changed, 9 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

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

>  {
> +#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
Lothar Waßmann July 14, 2017, 6:47 a.m. UTC | #2
Hi,

On Thu, 13 Jul 2017 16:45:00 +0200 Stefano Babic wrote:
> On 13/07/2017 07:57, 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>
> > ---
> >  drivers/net/fec_mxc.c | 9 +++++++++
> >  1 file changed, 9 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
> 
> 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
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;