netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mdio_bus: don't return NULL from mdiobus_scan()
@ 2016-05-03 20:14 Sergei Shtylyov
  2016-05-04 20:14 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2016-05-03 20:14 UTC (permalink / raw)
  To: netdev, f.fainelli

I've finally noticed that mdiobus_scan() also returns either NULL or error
value on failure.  Return ERR_PTR(-ENODEV) instead of NULL since this is
the  error value  already filtered out by the callers that want to ignore
the  MDIO address scan failure...

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

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

 drivers/net/phy/mdio_bus.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: net-next/drivers/net/phy/mdio_bus.c
===================================================================
--- net-next.orig/drivers/net/phy/mdio_bus.c
+++ net-next/drivers/net/phy/mdio_bus.c
@@ -435,7 +435,7 @@ struct phy_device *mdiobus_scan(struct m
 	err = phy_device_register(phydev);
 	if (err) {
 		phy_device_free(phydev);
-		return NULL;
+		return ERR_PTR(-ENODEV);
 	}
 
 	return phydev;

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

end of thread, other threads:[~2016-05-04 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03 20:14 [PATCH] mdio_bus: don't return NULL from mdiobus_scan() Sergei Shtylyov
2016-05-04 20:14 ` 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).