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/musb/blackfin.c | |
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/musb/blackfin.c')
-rw-r--r-- | drivers/usb/musb/blackfin.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 452940986d6d..428e6aa3e78a 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/gpio.h> | 16 | #include <linux/gpio.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/err.h> | ||
18 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
19 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
20 | #include <linux/prefetch.h> | 21 | #include <linux/prefetch.h> |
@@ -416,7 +417,7 @@ static int bfin_musb_init(struct musb *musb) | |||
416 | 417 | ||
417 | usb_nop_xceiv_register(); | 418 | usb_nop_xceiv_register(); |
418 | musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); | 419 | musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); |
419 | if (!musb->xceiv) { | 420 | if (IS_ERR_OR_NULL(musb->xceiv)) { |
420 | gpio_free(musb->config->gpio_vrsel); | 421 | gpio_free(musb->config->gpio_vrsel); |
421 | return -ENODEV; | 422 | return -ENODEV; |
422 | } | 423 | } |