diff mbox series

[U-Boot,v5,1/3] net: mdio-uclass: rename arguments of dm_mdio_phy_connect for clarity

Message ID 20191125151513.24537-2-alexandru.marginean@nxp.com
State Accepted
Commit a5d32c37d9eec2f819273536a5600a0fbde09acb
Delegated to: Joe Hershberger
Headers show
Series Add helper function for linking a DM Eth device to a PHY | expand

Commit Message

Alexandru Marginean Nov. 25, 2019, 3:15 p.m. UTC
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(-)

Comments

Joe Hershberger Nov. 30, 2019, 12:19 a.m. UTC | #1
On Mon, Nov 25, 2019 at 9:17 AM Alex Marginean
<alexandru.marginean@nxp.com> wrote:
>
> 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>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff mbox series

Patch

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) = {