aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-fsl.c
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2012-06-26 08:10:32 -0400
committerFelipe Balbi <balbi@ti.com>2012-07-02 03:40:49 -0400
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 ba290589d858..32865a7145a8 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -27,6 +27,7 @@
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/pm.h> 29#include <linux/pm.h>
30#include <linux/err.h>
30#include <linux/platform_device.h> 31#include <linux/platform_device.h>
31#include <linux/fsl_devices.h> 32#include <linux/fsl_devices.h>
32 33
@@ -146,7 +147,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
146 dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n", 147 dev_dbg(&pdev->dev, "hcd=0x%p ehci=0x%p, transceiver=0x%p\n",
147 hcd, ehci, ehci->transceiver); 148 hcd, ehci, ehci->transceiver);
148 149
149 if (ehci->transceiver) { 150 if (!IS_ERR_OR_NULL(ehci->transceiver)) {
150 retval = otg_set_host(ehci->transceiver->otg, 151 retval = otg_set_host(ehci->transceiver->otg,
151 &ehci_to_hcd(ehci)->self); 152 &ehci_to_hcd(ehci)->self);
152 if (retval) { 153 if (retval) {
@@ -192,7 +193,7 @@ static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
192 struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; 193 struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
193 struct ehci_hcd *ehci = hcd_to_ehci(hcd); 194 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
194 195
195 if (ehci->transceiver) { 196 if (!IS_ERR_OR_NULL(ehci->transceiver)) {
196 otg_set_host(ehci->transceiver->otg, NULL); 197 otg_set_host(ehci->transceiver->otg, NULL);
197 usb_put_phy(ehci->transceiver); 198 usb_put_phy(ehci->transceiver);
198 } 199 }