diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2012-06-26 08:10:32 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-07-02 03:40:49 -0400 |
commit | ded017ee6c7b90f7356bd8488f8af1c10ba90490 (patch) | |
tree | 1ed1612aa13f24e1aa8480fb497d2a0311fae9cc /drivers/usb/otg | |
parent | b8a3efa3a363720687d21228d6b23b988a223bbb (diff) |
usb: phy: fix return value check of usb_get_phy
usb_get_phy will return -ENODEV if it's not able to find the phy. Hence
fixed all the callers of usb_get_phy to check for this error condition
instead of relying on a non-zero value as success condition.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/otg')
-rw-r--r-- | drivers/usb/otg/otg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c index 0fa4d8c1b1e8..88d62b16f632 100644 --- a/drivers/usb/otg/otg.c +++ b/drivers/usb/otg/otg.c | |||
@@ -67,7 +67,7 @@ struct usb_phy *devm_usb_get_phy(struct device *dev, enum usb_phy_type type) | |||
67 | return NULL; | 67 | return NULL; |
68 | 68 | ||
69 | phy = usb_get_phy(type); | 69 | phy = usb_get_phy(type); |
70 | if (phy) { | 70 | if (!IS_ERR(phy)) { |
71 | *ptr = phy; | 71 | *ptr = phy; |
72 | devres_add(dev, ptr); | 72 | devres_add(dev, ptr); |
73 | } else | 73 | } else |
@@ -82,7 +82,7 @@ EXPORT_SYMBOL(devm_usb_get_phy); | |||
82 | * @type - the type of the phy the controller requires | 82 | * @type - the type of the phy the controller requires |
83 | * | 83 | * |
84 | * Returns the phy driver, after getting a refcount to it; or | 84 | * Returns the phy driver, after getting a refcount to it; or |
85 | * null if there is no such phy. The caller is responsible for | 85 | * -ENODEV if there is no such phy. The caller is responsible for |
86 | * calling usb_put_phy() to release that count. | 86 | * calling usb_put_phy() to release that count. |
87 | * | 87 | * |
88 | * For use by USB host and peripheral drivers. | 88 | * For use by USB host and peripheral drivers. |