net: mdiobus: Convert to use fwnode_device_is_compatible()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 19 Jan 2023 17:50:10 +0000 (19:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Jan 2023 14:37:13 +0000 (14:37 +0000)
Replace open coded fwnode_device_is_compatible() in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mdio/fwnode_mdio.c

index b782c35c4ac144a885b9f428e346f56f91a42d94..1183ef5e203e3e248f1d73a22ccd04ea7b063851 100644 (file)
@@ -115,7 +115,7 @@ int fwnode_mdiobus_register_phy(struct mii_bus *bus,
        struct mii_timestamper *mii_ts = NULL;
        struct pse_control *psec = NULL;
        struct phy_device *phy;
-       bool is_c45 = false;
+       bool is_c45;
        u32 phy_id;
        int rc;
 
@@ -129,11 +129,7 @@ int fwnode_mdiobus_register_phy(struct mii_bus *bus,
                goto clean_pse;
        }
 
-       rc = fwnode_property_match_string(child, "compatible",
-                                         "ethernet-phy-ieee802.3-c45");
-       if (rc >= 0)
-               is_c45 = true;
-
+       is_c45 = fwnode_device_is_compatible(child, "ethernet-phy-ieee802.3-c45");
        if (is_c45 || fwnode_get_phy_id(child, &phy_id))
                phy = get_phy_device(bus, addr, is_c45);
        else