projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drm/i915: use linux/stddef.h due to "isystem: trim/fixup stdarg.h and other headers"
[linux-2.6-microblaze.git]
/
drivers
/
phy
/
phy-core.c
diff --git
a/drivers/phy/phy-core.c
b/drivers/phy/phy-core.c
index
ccb575b
..
91e28d6
100644
(file)
--- a/
drivers/phy/phy-core.c
+++ b/
drivers/phy/phy-core.c
@@
-697,16
+697,18
@@
struct phy *phy_get(struct device *dev, const char *string)
struct phy *phy;
struct device_link *link;
struct phy *phy;
struct device_link *link;
- if (string == NULL) {
- dev_WARN(dev, "missing string\n");
- return ERR_PTR(-EINVAL);
- }
-
if (dev->of_node) {
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 {
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))
phy = phy_find(dev, string);
}
if (IS_ERR(phy))