Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 639dab36 authored by Russell King's avatar Russell King Committed by Greg Kroah-Hartman
Browse files

sfp: fix non-detection of PHY




[ Upstream commit 20b56ed9f8adfb9a7fb1c878878c54aa4ed645c1 ]

The detection of a PHY changed in commit e98a3aab ("mdio_bus: don't
return NULL from mdiobus_scan()") which now causes sfp to print an
error message.  Update for this change.

Fixes: 73970055 ("sfp: add SFP module support")
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1a6610de
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -318,12 +318,12 @@ static void sfp_sm_probe_phy(struct sfp *sfp)
	msleep(T_PHY_RESET_MS);

	phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR);
	if (IS_ERR(phy)) {
		dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy));
	if (phy == ERR_PTR(-ENODEV)) {
		dev_info(sfp->dev, "no PHY detected\n");
		return;
	}
	if (!phy) {
		dev_info(sfp->dev, "no PHY detected\n");
	if (IS_ERR(phy)) {
		dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy));
		return;
	}