devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of_mdio: make of_mdiobus_register_{device|phy}() *void*
@ 2016-04-16 22:05 Sergei Shtylyov
  2016-04-18  4:02 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2016-04-16 22:05 UTC (permalink / raw)
  To: grant.likely, robh+dt, devicetree, f.fainelli, netdev,
	frowand.list

The results of of_mdiobus_register_{device|phy}() are never checked, so we
can make  both these functions *void*...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against DaveM's 'net-next.git' repo.

 drivers/of/of_mdio.c |   21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

Index: net-next/drivers/of/of_mdio.c
===================================================================
--- net-next.orig/drivers/of/of_mdio.c
+++ net-next/drivers/of/of_mdio.c
@@ -41,8 +41,8 @@ static int of_get_phy_id(struct device_n
 	return -EINVAL;
 }
 
-static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *child,
-				   u32 addr)
+static void of_mdiobus_register_phy(struct mii_bus *mdio,
+				    struct device_node *child, u32 addr)
 {
 	struct phy_device *phy;
 	bool is_c45;
@@ -57,7 +57,7 @@ static int of_mdiobus_register_phy(struc
 	else
 		phy = get_phy_device(mdio, addr, is_c45);
 	if (IS_ERR_OR_NULL(phy))
-		return 1;
+		return;
 
 	rc = irq_of_parse_and_map(child, 0);
 	if (rc > 0) {
@@ -81,25 +81,22 @@ static int of_mdiobus_register_phy(struc
 	if (rc) {
 		phy_device_free(phy);
 		of_node_put(child);
-		return 1;
+		return;
 	}
 
 	dev_dbg(&mdio->dev, "registered phy %s at address %i\n",
 		child->name, addr);
-
-	return 0;
 }
 
-static int of_mdiobus_register_device(struct mii_bus *mdio,
-				      struct device_node *child,
-				      u32 addr)
+static void of_mdiobus_register_device(struct mii_bus *mdio,
+				       struct device_node *child, u32 addr)
 {
 	struct mdio_device *mdiodev;
 	int rc;
 
 	mdiodev = mdio_device_create(mdio, addr);
 	if (IS_ERR(mdiodev))
-		return 1;
+		return;
 
 	/* Associate the OF node with the device structure so it
 	 * can be looked up later.
@@ -112,13 +109,11 @@ static int of_mdiobus_register_device(st
 	if (rc) {
 		mdio_device_free(mdiodev);
 		of_node_put(child);
-		return 1;
+		return;
 	}
 
 	dev_dbg(&mdio->dev, "registered mdio device %s at address %i\n",
 		child->name, addr);
-
-	return 0;
 }
 
 int of_mdio_parse_addr(struct device *dev, const struct device_node *np)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] of_mdio: make of_mdiobus_register_{device|phy}() *void*
  2016-04-16 22:05 [PATCH] of_mdio: make of_mdiobus_register_{device|phy}() *void* Sergei Shtylyov
@ 2016-04-18  4:02 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-04-18  4:02 UTC (permalink / raw)
  To: sergei.shtylyov
  Cc: grant.likely, robh+dt, devicetree, f.fainelli, netdev,
	frowand.list

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sun, 17 Apr 2016 01:05:19 +0300

> The results of of_mdiobus_register_{device|phy}() are never checked, so we
> can make  both these functions *void*...
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied, thanks Sergei.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-18  4:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-16 22:05 [PATCH] of_mdio: make of_mdiobus_register_{device|phy}() *void* Sergei Shtylyov
2016-04-18  4:02 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).