sched: Prevent balance_push() on remote runqueues
[linux-2.6-microblaze.git] / drivers / phy / phy-core.c
index ccb575b..91e28d6 100644 (file)
@@ -697,16 +697,18 @@ struct phy *phy_get(struct device *dev, const char *string)
        struct phy *phy;
        struct device_link *link;
 
-       if (string == NULL) {
-               dev_WARN(dev, "missing string\n");
-               return ERR_PTR(-EINVAL);
-       }
-
        if (dev->of_node) {
-               index = of_property_match_string(dev->of_node, "phy-names",
-                       string);
+               if (string)
+                       index = of_property_match_string(dev->of_node, "phy-names",
+                               string);
+               else
+                       index = 0;
                phy = _of_phy_get(dev->of_node, index);
        } else {
+               if (string == NULL) {
+                       dev_WARN(dev, "missing string\n");
+                       return ERR_PTR(-EINVAL);
+               }
                phy = phy_find(dev, string);
        }
        if (IS_ERR(phy))