All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Marginean <alexandru.marginean@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 1/3] net: mdio-uclass: rename arguments of dm_mdio_phy_connect for clarity
Date: Mon, 25 Nov 2019 17:15:11 +0200	[thread overview]
Message-ID: <20191125151513.24537-2-alexandru.marginean@nxp.com> (raw)
In-Reply-To: <20191125151513.24537-1-alexandru.marginean@nxp.com>

Renamed dm_mdio_phy_connect arguments dev to mdiodev and addr to phyaddr
for a bit more clarity and consistency with the following patches.
Also use NULL instead of 0 on error return path.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
---
 include/miiphy.h  |  6 +++---
 net/mdio-uclass.c | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/miiphy.h b/include/miiphy.h
index 9b97d09f18..94bf0da24a 100644
--- a/include/miiphy.h
+++ b/include/miiphy.h
@@ -154,14 +154,14 @@ void dm_mdio_probe_devices(void);
 /**
  * dm_mdio_phy_connect - Wrapper over phy_connect for DM MDIO
  *
- * @dev: mdio dev
- * @addr: PHY address on MDIO bus
+ * @mdiodev: mdio device the PHY is accesible on
+ * @phyaddr: PHY address on MDIO bus
  * @ethdev: ethernet device to connect to the PHY
  * @interface: MAC-PHY protocol
  *
  * @return pointer to phy_device, or 0 on error
  */
-struct phy_device *dm_mdio_phy_connect(struct udevice *dev, int addr,
+struct phy_device *dm_mdio_phy_connect(struct udevice *mdiodev, int phyaddr,
 				       struct udevice *ethdev,
 				       phy_interface_t interface);
 
diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c
index 6f922e80b6..7a5f1d6dcc 100644
--- a/net/mdio-uclass.c
+++ b/net/mdio-uclass.c
@@ -104,16 +104,16 @@ static int dm_mdio_pre_remove(struct udevice *dev)
 	return 0;
 }
 
-struct phy_device *dm_mdio_phy_connect(struct udevice *dev, int addr,
+struct phy_device *dm_mdio_phy_connect(struct udevice *mdiodev, int phyaddr,
 				       struct udevice *ethdev,
 				       phy_interface_t interface)
 {
-	struct mdio_perdev_priv *pdata = dev_get_uclass_priv(dev);
+	struct mdio_perdev_priv *pdata = dev_get_uclass_priv(mdiodev);
 
-	if (device_probe(dev))
-		return 0;
+	if (device_probe(mdiodev))
+		return NULL;
 
-	return phy_connect(pdata->mii_bus, addr, ethdev, interface);
+	return phy_connect(pdata->mii_bus, phyaddr, ethdev, interface);
 }
 
 UCLASS_DRIVER(mdio) = {
-- 
2.17.1

  reply	other threads:[~2019-11-25 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 15:15 [U-Boot] [PATCH v5 0/3] Add helper function for linking a DM Eth device to a PHY Alex Marginean
2019-11-25 15:15 ` Alex Marginean [this message]
2019-11-30  0:19   ` [U-Boot] [PATCH v5 1/3] net: mdio-uclass: rename arguments of dm_mdio_phy_connect for clarity Joe Hershberger
2019-11-25 15:15 ` [U-Boot] [PATCH v5 2/3] net: mdio-uclass: add dm_eth_phy_connect helper function Alex Marginean
2019-11-30  0:20   ` Joe Hershberger
2019-11-25 15:15 ` [U-Boot] [PATCH v5 3/3] drivers: net: fsl_enetc: use the new MDIO DM helper functions Alex Marginean
2019-11-30  0:21   ` 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=20191125151513.24537-2-alexandru.marginean@nxp.com \
    --to=alexandru.marginean@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.