]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/of/of_mdio.c
net: dsa: microchip: Add shared regmap mutex
[linux.git] / drivers / of / of_mdio.c
index 44f53496cab1bef8bf29e759973c3c92eb1f8468..bd6129db641782c653b14c56dcb887d47124ad51 100644 (file)
@@ -280,12 +280,6 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 }
 EXPORT_SYMBOL(of_mdiobus_register);
 
-/* Helper function for of_phy_find_device */
-static int of_phy_match(struct device *dev, const void *phy_np)
-{
-       return dev->of_node == phy_np;
-}
-
 /**
  * of_phy_find_device - Give a PHY node, find the phy_device
  * @phy_np: Pointer to the phy's device tree node
@@ -301,7 +295,7 @@ struct phy_device *of_phy_find_device(struct device_node *phy_np)
        if (!phy_np)
                return NULL;
 
-       d = bus_find_device(&mdio_bus_type, NULL, phy_np, of_phy_match);
+       d = bus_find_device_by_of_node(&mdio_bus_type, phy_np);
        if (d) {
                mdiodev = to_mdio_device(d);
                if (mdiodev->flags & MDIO_DEVICE_FLAG_PHY)
@@ -368,7 +362,7 @@ struct phy_device *of_phy_get_and_connect(struct net_device *dev,
        int ret;
 
        iface = of_get_phy_mode(np);
-       if (iface < 0)
+       if ((int)iface < 0)
                return NULL;
        if (of_phy_is_fixed_link(np)) {
                ret = of_phy_register_fixed_link(np);