aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ohci-pxa27x.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 3b1cfe939483..acde8868da21 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -309,20 +309,22 @@ static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev)
309 struct usb_hcd *hcd = platform_get_drvdata(pdev); 309 struct usb_hcd *hcd = platform_get_drvdata(pdev);
310 310
311 usb_hcd_pxa27x_remove(hcd, pdev); 311 usb_hcd_pxa27x_remove(hcd, pdev);
312 platform_set_drvdata(pdev, NULL);
312 return 0; 313 return 0;
313} 314}
314 315
315#ifdef CONFIG_PM 316#ifdef CONFIG_PM
316static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state) 317static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state)
317{ 318{
318 struct ohci_hcd *ohci = platform_get_drvdata(pdev); 319 struct usb_hcd *hcd = platform_get_drvdata(pdev);
320 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
319 321
320 if (time_before(jiffies, ohci->next_statechange)) 322 if (time_before(jiffies, ohci->next_statechange))
321 msleep(5); 323 msleep(5);
322 ohci->next_statechange = jiffies; 324 ohci->next_statechange = jiffies;
323 325
324 pxa27x_stop_hc(&pdev->dev); 326 pxa27x_stop_hc(&pdev->dev);
325 ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED; 327 hcd->state = HC_STATE_SUSPENDED;
326 pdev->dev.power.power_state = PMSG_SUSPEND; 328 pdev->dev.power.power_state = PMSG_SUSPEND;
327 329
328 return 0; 330 return 0;
@@ -330,7 +332,8 @@ static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_
330 332
331static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev) 333static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
332{ 334{
333 struct ohci_hcd *ohci = platform_get_drvdata(pdev); 335 struct usb_hcd *hcd = platform_get_drvdata(pdev);
336 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
334 int status; 337 int status;
335 338
336 if (time_before(jiffies, ohci->next_statechange)) 339 if (time_before(jiffies, ohci->next_statechange))
@@ -341,7 +344,7 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
341 return status; 344 return status;
342 345
343 pdev->dev.power.power_state = PMSG_ON; 346 pdev->dev.power.power_state = PMSG_ON;
344 usb_hcd_resume_root_hub(platform_get_drvdata(pdev)); 347 usb_hcd_resume_root_hub(hcd);
345 348
346 return 0; 349 return 0;
347} 350}