Skip to content

Commit e3f2d55

Browse files
Leon Romanovskydavem330
authored andcommitted
net: phy: propagate an error back to the callers of phy_sfp_probe
The compilation warning below reveals that the errors returned from the sfp_bus_add_upstream() call are not propagated to the callers. Fix it by returning "ret". 14:37:51 drivers/net/phy/phy_device.c: In function 'phy_sfp_probe': 14:37:51 drivers/net/phy/phy_device.c:1236:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] 14:37:51 1236 | int ret; 14:37:51 | ^~~ Fixes: 298e54f ("net: phy: add core phylib sfp support") Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a6211ca commit e3f2d55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/phy/phy_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ int phy_sfp_probe(struct phy_device *phydev,
12331233
const struct sfp_upstream_ops *ops)
12341234
{
12351235
struct sfp_bus *bus;
1236-
int ret;
1236+
int ret = 0;
12371237

12381238
if (phydev->mdio.dev.fwnode) {
12391239
bus = sfp_bus_find_fwnode(phydev->mdio.dev.fwnode);
@@ -1245,7 +1245,7 @@ int phy_sfp_probe(struct phy_device *phydev,
12451245
ret = sfp_bus_add_upstream(bus, phydev, ops);
12461246
sfp_bus_put(bus);
12471247
}
1248-
return 0;
1248+
return ret;
12491249
}
12501250
EXPORT_SYMBOL(phy_sfp_probe);
12511251

0 commit comments

Comments
 (0)