All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3 2/6] net: fec_mxc: simplify fec_get_miibus
Date: Wed, 28 Mar 2018 20:54:12 +0800	[thread overview]
Message-ID: <20180328125416.28056-2-peng.fan@nxp.com> (raw)
In-Reply-To: <20180328125416.28056-1-peng.fan@nxp.com>

No need to provide two prototype for this function.
Use ulong for the first parameter, then this function
could be shared for DM/non DM case.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---

V3:
 None
V2:
 Drop uneccessary ulong

 drivers/net/fec_mxc.c | 15 +++------------
 include/netdev.h      |  6 +-----
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 617e504293..953252a92e 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1011,18 +1011,9 @@ 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
+struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id)
 {
-#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 *)(ulong)base_addr;
-#endif
+	struct ethernet_regs *eth = (struct ethernet_regs *)base_addr;
 	struct mii_dev *bus;
 	int ret;
 
@@ -1282,7 +1273,7 @@ static int fecmxc_probe(struct udevice *dev)
 	fec_reg_setup(priv);
 	priv->dev_id = (dev_id == -1) ? 0 : dev_id;
 
-	bus = fec_get_miibus(dev, dev_id);
+	bus = fec_get_miibus((ulong)priv->eth, dev_id);
 	if (!bus) {
 		ret = -ENOMEM;
 		goto err_mii;
diff --git a/include/netdev.h b/include/netdev.h
index 3958a4cd32..c96f851be0 100644
--- a/include/netdev.h
+++ b/include/netdev.h
@@ -119,11 +119,7 @@ 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
+struct mii_dev *fec_get_miibus(ulong base_addr, int dev_id);
 
 #ifdef CONFIG_PHYLIB
 struct phy_device;
-- 
2.14.1

  reply	other threads:[~2018-03-28 12:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 12:54 [U-Boot] [PATCH V3 1/6] net: fec_mxc: Fix DM driver issue in recv Peng Fan
2018-03-28 12:54 ` Peng Fan [this message]
2018-04-15  4:15   ` [U-Boot] net: fec_mxc: simplify fec_get_miibus Joe Hershberger
2018-03-28 12:54 ` [U-Boot] [PATCH V3 3/6] net: fec: set dev->seq to priv->dev_id Peng Fan
2018-04-15  4:15   ` [U-Boot] " Joe Hershberger
2018-03-28 12:54 ` [U-Boot] [PATCH V3 4/6] net: fec: sharing MDIO for two enet controllers Peng Fan
2018-04-15  4:15   ` [U-Boot] " Joe Hershberger
2018-03-28 12:54 ` [U-Boot] [PATCH V3 5/6] net: fex_mxc: add i.MX6UL/SX/SL compatible Peng Fan
2018-04-15  4:15   ` [U-Boot] " Joe Hershberger
2018-03-28 12:54 ` [U-Boot] [PATCH V3 6/6] net: fec: Fix issue in DM probe timeout Peng Fan
2018-03-29  3:36   ` Joe Hershberger
2018-04-15  4:16   ` [U-Boot] " Joe Hershberger
2018-04-15  4:15 ` [U-Boot] net: fec_mxc: Fix DM driver issue in recv Joe Hershberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180328125416.28056-2-peng.fan@nxp.com \
    --to=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.