Openwrt/target/linux/ipq40xx/patches-5.4/706-ar40xx-abort-probe-on-missig-phy.patch
Christian Lamparter 91a7c9c27d ipq40xx: 5.4: refresh patches and config
This patch just refreshes the 5.4 patches. It seems as if
070-v4.20-soc-qcom-spm-add-SCM-probe-dependency.patch is
already applied, so drop it. It also does a quick
make kernel_oldconfig to get rid of unneeded symbols.

[Looks like USB and Ethernet need some more work].

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2020-02-28 22:46:27 +01:00

35 lines
955 B
Diff

--- a/drivers/net/phy/ar40xx.c
+++ b/drivers/net/phy/ar40xx.c
@@ -1808,8 +1808,8 @@ ar40xx_phy_probe(struct phy_device *phyd
if (phydev->mdio.addr == 0)
ar40xx_priv->phy = phydev;
- phydev->supported |= SUPPORTED_1000baseT_Full;
- phydev->advertising |= ADVERTISED_1000baseT_Full;
+ phy_set_max_speed(phydev, SPEED_1000);
+ linkmode_copy(phydev->advertising, phydev->supported);
return 0;
}
@@ -2021,6 +2021,12 @@ static int ar40xx_probe(struct platform_
/* register switch */
swdev = &priv->dev;
+ if (priv->mii_bus == NULL) {
+ dev_err(&pdev->dev, "Probe failed - Missing PHYs!\n");
+ ret = -ENODEV;
+ goto err_missing_phy;
+ }
+
swdev->alias = dev_name(&priv->mii_bus->dev);
swdev->cpu_port = AR40XX_PORT_CPU;
@@ -2052,6 +2058,7 @@ err_unregister_switch:
unregister_switch(&priv->dev);
err_unregister_phy:
phy_driver_unregister(&ar40xx_phy_driver);
+err_missing_phy:
platform_set_drvdata(pdev, NULL);
return ret;
}