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.shtyl...@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;

Reply via email to