mdio_bus: don't return NULL from mdiobus_scan()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
---
The patch is against DaveM's 'net-next.git' repo.
drivers/net/phy/mdio_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/mdio_bus.c +1 -1
@@ -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;
From: Sergei Shtylyov <[email protected]>
Date: Tue, 03 May 2016 23:14:41 +0300
Quoted 6 lines
I've finally noticed that
mdiobus_scan()also returns either NULL or error value on failure. ReturnERR_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 <[email protected]>
Applied.