summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-fsl.c
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2012-06-26 17:40:32 +0530
committerFelipe Balbi <balbi@ti.com>2012-07-02 10:40:49 +0300
commitded017ee6c7b90f7356bd8488f8af1c10ba90490 (patch)
tree1ed1612aa13f24e1aa8480fb497d2a0311fae9cc /drivers/usb/host/ehci-fsl.c
parentb8a3efa3a363720687d21228d6b23b988a223bbb (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/host/ehci-fsl.c')
-rw-r--r--drivers/usb/host/ehci-fsl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index ba290589d85..32865a7145a 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);
}