summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-arc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-arc.c')
-rwxr-xr-xdrivers/usb/host/ehci-arc.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/usb/host/ehci-arc.c b/drivers/usb/host/ehci-arc.c
index 08324a62292e..471998ac2566 100755
--- a/drivers/usb/host/ehci-arc.c
+++ b/drivers/usb/host/ehci-arc.c
@@ -258,21 +258,8 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
fsl_platform_set_host_mode(hcd);
hcd->power_budget = pdata->power_budget;
- /*
- * The ehci_fsl_pre_irq must be registered before usb_hcd_irq, in that case
- * it can be called before usb_hcd_irq when irq occurs
- */
- retval = request_irq(irq, ehci_fsl_pre_irq, IRQF_SHARED,
- "fsl ehci pre interrupt", (void *)pdev);
- if (retval != 0)
- goto err4;
-
- retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
- if (retval != 0)
- goto err5;
-
+ ehci = hcd_to_ehci(hcd);
if (pdata->operating_mode == FSL_USB2_DR_OTG) {
- struct ehci_hcd *ehci = hcd_to_ehci(hcd);
dbg("pdev=0x%p hcd=0x%p ehci=0x%p\n", pdev, hcd, ehci);
@@ -282,7 +269,7 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
if (!ehci->transceiver) {
printk(KERN_ERR "can't find transceiver\n");
retval = -ENODEV;
- goto err6;
+ goto err4;
}
retval = otg_set_host(ehci->transceiver, &ehci_to_hcd(ehci)->self);
@@ -292,6 +279,19 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
(pdata->operating_mode == FSL_USB2_DR_HOST))
fsl_platform_set_vbus_power(pdata, 1);
+ /*
+ * The ehci_fsl_pre_irq must be registered before usb_hcd_irq, in that case
+ * it can be called before usb_hcd_irq when irq occurs
+ */
+ retval = request_irq(irq, ehci_fsl_pre_irq, IRQF_SHARED,
+ "fsl ehci pre interrupt", (void *)pdev);
+ if (retval != 0)
+ goto err5;
+
+ retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
+ if (retval != 0)
+ goto err6;
+
fsl_platform_set_ahb_burst(hcd);
ehci_testmode_init(hcd_to_ehci(hcd));
/*
@@ -306,9 +306,9 @@ int usb_hcd_fsl_probe(const struct hc_driver *driver,
pdata->pm_command = ehci->command;
return retval;
err6:
- usb_remove_hcd(hcd);
-err5:
free_irq(irq, (void *)pdev);
+err5:
+ otg_put_transceiver(ehci->transceiver);
err4:
iounmap(hcd->regs);
err3: