From: Sergei Shtylyov Date: Tue, 3 May 2016 20:14:41 +0000 (+0300) Subject: mdio_bus: don't return NULL from mdiobus_scan() X-Git-Tag: MMI-PSA29.97-13-9~7934^2~118 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e98a3aabf85f60b80c6ef93e509d38144ca434b1;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mdio_bus: don't return NULL from mdiobus_scan() 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 388f9922647b..09deef4bed09 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -431,7 +431,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr) err = phy_device_register(phydev); if (err) { phy_device_free(phydev); - return NULL; + return ERR_PTR(-ENODEV); } return phydev;