]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: zynq: Use generic_phy_valid() helper
authorJonas Karlman <jonas@kwiboo.se>
Thu, 31 Aug 2023 22:16:38 +0000 (22:16 +0000)
committerTom Rini <trini@konsulko.com>
Wed, 13 Sep 2023 19:52:20 +0000 (15:52 -0400)
The documentation for struct phy state that "The content of the
structure is managed solely by the PHY API and PHY drivers".

Change to use the generic_phy_valid() helper to check if phy is valid.

Fixes: 10c50b1facbf ("net: zynq: Add support for PHY configuration in SGMII mode")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
drivers/net/zynq_gem.c

index f3cdfb0275d0402c944f984afdab4ef26d56008c..3377e669f2f69d53ee5066592683d437692244a1 100644 (file)
@@ -890,7 +890,8 @@ static int zynq_gem_probe(struct udevice *dev)
        if (ret)
                goto err3;
 
-       if (priv->interface == PHY_INTERFACE_MODE_SGMII && phy.dev) {
+       if (priv->interface == PHY_INTERFACE_MODE_SGMII &&
+           generic_phy_valid(&phy)) {
                if (IS_ENABLED(CONFIG_DM_ETH_PHY)) {
                        if (device_is_compatible(dev, "cdns,zynqmp-gem") ||
                            device_is_compatible(dev, "xlnx,zynqmp-gem")) {