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/davinci.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/davinci.c')
-rw-r--r-- | drivers/usb/musb/davinci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 582268de3fa2..f6492043655e 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/list.h> | 28 | #include <linux/list.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/clk.h> | 30 | #include <linux/clk.h> |
31 | #include <linux/err.h> | ||
31 | #include <linux/io.h> | 32 | #include <linux/io.h> |
32 | #include <linux/gpio.h> | 33 | #include <linux/gpio.h> |
33 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
@@ -385,7 +386,7 @@ static int davinci_musb_init(struct musb *musb) | |||
385 | 386 | ||
386 | usb_nop_xceiv_register(); | 387 | usb_nop_xceiv_register(); |
387 | musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); | 388 | musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); |
388 | if (!musb->xceiv) | 389 | if (IS_ERR_OR_NULL(musb->xceiv)) |
389 | goto unregister; | 390 | goto unregister; |
390 | 391 | ||
391 | musb->mregs += DAVINCI_BASE_OFFSET; | 392 | musb->mregs += DAVINCI_BASE_OFFSET; |