aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-fsl.c5
-rw-r--r--drivers/usb/host/ehci-msm.c2
-rw-r--r--drivers/usb/host/ehci-mv.c7
-rw-r--r--drivers/usb/host/ehci-tegra.c7
-rw-r--r--drivers/usb/host/ohci-omap.c5
5 files changed, 15 insertions, 11 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 }
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index c7615fb93dbb..6b4ffb598db1 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -146,7 +146,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
146 * management. 146 * management.
147 */ 147 */
148 phy = usb_get_phy(USB_PHY_TYPE_USB2); 148 phy = usb_get_phy(USB_PHY_TYPE_USB2);
149 if (!phy) { 149 if (IS_ERR_OR_NULL(phy)) {
150 dev_err(&pdev->dev, "unable to find transceiver\n"); 150 dev_err(&pdev->dev, "unable to find transceiver\n");
151 ret = -ENODEV; 151 ret = -ENODEV;
152 goto unmap; 152 goto unmap;
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index ef7aa0df40a6..0e8c168ca24c 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/clk.h> 15#include <linux/clk.h>
16#include <linux/err.h>
16#include <linux/usb/otg.h> 17#include <linux/usb/otg.h>
17#include <linux/platform_data/mv_usb.h> 18#include <linux/platform_data/mv_usb.h>
18 19
@@ -254,7 +255,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
254 if (ehci_mv->mode == MV_USB_MODE_OTG) { 255 if (ehci_mv->mode == MV_USB_MODE_OTG) {
255#ifdef CONFIG_USB_OTG_UTILS 256#ifdef CONFIG_USB_OTG_UTILS
256 ehci_mv->otg = usb_get_phy(USB_PHY_TYPE_USB2); 257 ehci_mv->otg = usb_get_phy(USB_PHY_TYPE_USB2);
257 if (!ehci_mv->otg) { 258 if (IS_ERR_OR_NULL(ehci_mv->otg)) {
258 dev_err(&pdev->dev, 259 dev_err(&pdev->dev,
259 "unable to find transceiver\n"); 260 "unable to find transceiver\n");
260 retval = -ENODEV; 261 retval = -ENODEV;
@@ -302,7 +303,7 @@ err_set_vbus:
302 pdata->set_vbus(0); 303 pdata->set_vbus(0);
303#ifdef CONFIG_USB_OTG_UTILS 304#ifdef CONFIG_USB_OTG_UTILS
304err_put_transceiver: 305err_put_transceiver:
305 if (ehci_mv->otg) 306 if (!IS_ERR_OR_NULL(ehci_mv->otg))
306 usb_put_phy(ehci_mv->otg); 307 usb_put_phy(ehci_mv->otg);
307#endif 308#endif
308err_disable_clk: 309err_disable_clk:
@@ -331,7 +332,7 @@ static int mv_ehci_remove(struct platform_device *pdev)
331 if (hcd->rh_registered) 332 if (hcd->rh_registered)
332 usb_remove_hcd(hcd); 333 usb_remove_hcd(hcd);
333 334
334 if (ehci_mv->otg) { 335 if (!IS_ERR_OR_NULL(ehci_mv->otg)) {
335 otg_set_host(ehci_mv->otg->otg, NULL); 336 otg_set_host(ehci_mv->otg->otg, NULL);
336 usb_put_phy(ehci_mv->otg); 337 usb_put_phy(ehci_mv->otg);
337 } 338 }
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 14df2f5cf6ae..477ecfa05154 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/err.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/platform_data/tegra_usb.h> 22#include <linux/platform_data/tegra_usb.h>
22#include <linux/irq.h> 23#include <linux/irq.h>
@@ -750,7 +751,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
750#ifdef CONFIG_USB_OTG_UTILS 751#ifdef CONFIG_USB_OTG_UTILS
751 if (pdata->operating_mode == TEGRA_USB_OTG) { 752 if (pdata->operating_mode == TEGRA_USB_OTG) {
752 tegra->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); 753 tegra->transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
753 if (tegra->transceiver) 754 if (!IS_ERR_OR_NULL(tegra->transceiver))
754 otg_set_host(tegra->transceiver->otg, &hcd->self); 755 otg_set_host(tegra->transceiver->otg, &hcd->self);
755 } 756 }
756#endif 757#endif
@@ -773,7 +774,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
773 774
774fail: 775fail:
775#ifdef CONFIG_USB_OTG_UTILS 776#ifdef CONFIG_USB_OTG_UTILS
776 if (tegra->transceiver) { 777 if (!IS_ERR_OR_NULL(tegra->transceiver)) {
777 otg_set_host(tegra->transceiver->otg, NULL); 778 otg_set_host(tegra->transceiver->otg, NULL);
778 usb_put_phy(tegra->transceiver); 779 usb_put_phy(tegra->transceiver);
779 } 780 }
@@ -808,7 +809,7 @@ static int tegra_ehci_remove(struct platform_device *pdev)
808 pm_runtime_put_noidle(&pdev->dev); 809 pm_runtime_put_noidle(&pdev->dev);
809 810
810#ifdef CONFIG_USB_OTG_UTILS 811#ifdef CONFIG_USB_OTG_UTILS
811 if (tegra->transceiver) { 812 if (!IS_ERR_OR_NULL(tegra->transceiver)) {
812 otg_set_host(tegra->transceiver->otg, NULL); 813 otg_set_host(tegra->transceiver->otg, NULL);
813 usb_put_phy(tegra->transceiver); 814 usb_put_phy(tegra->transceiver);
814 } 815 }
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 92a77dfd1930..c7b06f504c60 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -18,6 +18,7 @@
18#include <linux/jiffies.h> 18#include <linux/jiffies.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/err.h>
21#include <linux/gpio.h> 22#include <linux/gpio.h>
22 23
23#include <mach/hardware.h> 24#include <mach/hardware.h>
@@ -212,7 +213,7 @@ static int ohci_omap_init(struct usb_hcd *hcd)
212#ifdef CONFIG_USB_OTG 213#ifdef CONFIG_USB_OTG
213 if (need_transceiver) { 214 if (need_transceiver) {
214 ohci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); 215 ohci->transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
215 if (ohci->transceiver) { 216 if (!IS_ERR_OR_NULL(ohci->transceiver)) {
216 int status = otg_set_host(ohci->transceiver->otg, 217 int status = otg_set_host(ohci->transceiver->otg,
217 &ohci_to_hcd(ohci)->self); 218 &ohci_to_hcd(ohci)->self);
218 dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n", 219 dev_dbg(hcd->self.controller, "init %s transceiver, status %d\n",
@@ -403,7 +404,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
403 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 404 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
404 405
405 usb_remove_hcd(hcd); 406 usb_remove_hcd(hcd);
406 if (ohci->transceiver) { 407 if (!IS_ERR_OR_NULL(ohci->transceiver)) {
407 (void) otg_set_host(ohci->transceiver->otg, 0); 408 (void) otg_set_host(ohci->transceiver->otg, 0);
408 usb_put_phy(ohci->transceiver); 409 usb_put_phy(ohci->transceiver);
409 } 410 }