aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-s5p.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ohci-s5p.c')
-rw-r--r--drivers/usb/host/ohci-s5p.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/usb/host/ohci-s5p.c b/drivers/usb/host/ohci-s5p.c
index fce68ef..641e40c 100644
--- a/drivers/usb/host/ohci-s5p.c
+++ b/drivers/usb/host/ohci-s5p.c
@@ -191,6 +191,20 @@ static int ohci_hcd_s5p_drv_runtime_resume(struct device *dev)
#define ohci_hcd_s5p_drv_runtime_resume NULL
#endif
+static int ohci_s5p_init(struct usb_hcd *hcd)
+{
+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+ int ret;
+
+ ohci_dbg(ohci, "ohci_s5p_init, ohci:%p", ohci);
+
+ ret = ohci_init(ohci);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
+
static int ohci_s5p_start(struct usb_hcd *hcd)
{
struct ohci_hcd *ohci = hcd_to_ohci(hcd);
@@ -198,10 +212,6 @@ static int ohci_s5p_start(struct usb_hcd *hcd)
ohci_dbg(ohci, "ohci_s5p_start, ohci:%p", ohci);
- ret = ohci_init(ohci);
- if (ret < 0)
- return ret;
-
ret = ohci_run(ohci);
if (ret < 0) {
err("can't start %s", hcd->self.bus_name);
@@ -220,6 +230,7 @@ static const struct hc_driver ohci_s5p_hc_driver = {
.irq = ohci_irq,
.flags = HCD_MEMORY|HCD_USB11,
+ .reset = ohci_s5p_init,
.start = ohci_s5p_start,
.stop = ohci_stop,
.shutdown = ohci_shutdown,
@@ -447,7 +458,12 @@ static void ohci_hcd_s5p_drv_shutdown(struct platform_device *pdev)
{
struct s5p_ohci_platdata *pdata = pdev->dev.platform_data;
struct s5p_ohci_hcd *s5p_ohci = platform_get_drvdata(pdev);
- struct usb_hcd *hcd = s5p_ohci->hcd;
+ struct usb_hcd *hcd;
+
+ if (!pdata || !s5p_ohci)
+ return;
+
+ hcd = s5p_ohci->hcd;
if (!s5p_ohci->power_on)
return;