diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2012-06-26 14:10:32 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-07-02 09:40:49 +0200 |
commit | ded017ee6c7b90f7356bd8488f8af1c10ba90490 (patch) | |
tree | 1ed1612aa13f24e1aa8480fb497d2a0311fae9cc /drivers/usb/musb/am35x.c | |
parent | usb: otg: twl: use devres API to allocate resources (diff) | |
download | linux-ded017ee6c7b90f7356bd8488f8af1c10ba90490.tar.xz linux-ded017ee6c7b90f7356bd8488f8af1c10ba90490.zip |
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/am35x.c')
-rw-r--r-- | drivers/usb/musb/am35x.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index 4a8cbf0e8d51..7a95ab87ac00 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -29,6 +29,7 @@ #include <linux/init.h> #include <linux/module.h> #include <linux/clk.h> +#include <linux/err.h> #include <linux/io.h> #include <linux/platform_device.h> #include <linux/dma-mapping.h> @@ -365,7 +366,7 @@ static int am35x_musb_init(struct musb *musb) usb_nop_xceiv_register(); musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2); - if (!musb->xceiv) + if (IS_ERR_OR_NULL(musb->xceiv)) return -ENODEV; if (is_host_enabled(musb)) |