diff options
author | Kishon Vijay Abraham I <kishon@ti.com> | 2012-06-26 16:10:32 +0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-07-02 11:40:49 +0400 |
commit | ded017ee6c7b90f7356bd8488f8af1c10ba90490 (patch) | |
tree | 1ed1612aa13f24e1aa8480fb497d2a0311fae9cc /drivers/usb/host/ehci-fsl.c | |
parent | b8a3efa3a363720687d21228d6b23b988a223bbb (diff) | |
download | linux-ded017ee6c7b90f7356bd8488f8af1c10ba90490.tar.xz |
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/host/ehci-fsl.c')
-rw-r--r-- | drivers/usb/host/ehci-fsl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index ba290589d858..32865a7145a8 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -27,6 +27,7 @@ #include <linux/types.h> #include <linux/delay.h> #include <linux/pm.h> +#include <linux/err.h> #include <linux/platform_device.h> #include <linux/fsl_devices.h> @@ -146,7 +147,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n", hcd, ehci, ehci->transceiver); - if (ehci->transceiver) { + if (!IS_ERR_OR_NULL(ehci->transceiver)) { retval = otg_set_host(ehci->transceiver->otg, &ehci_to_hcd(ehci)->self); if (retval) { @@ -192,7 +193,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd, struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; struct ehci_hcd *ehci = hcd_to_ehci(hcd); - if (ehci->transceiver) { + if (!IS_ERR_OR_NULL(ehci->transceiver)) { otg_set_host(ehci->transceiver->otg, NULL); usb_put_phy(ehci->transceiver); } |