aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-11-28 17:15:46 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 16:51:40 -0500
commita5e36d20897ff8317e722fceb4d9eea3e4a5906b (patch)
treece2d7906a3980c0d31cf848d7f227409d4713092 /drivers/usb/host
parent4c4c9432a6c916729c7296c47fe93b053a73e20c (diff)
[PATCH] USB: Correct ohci-pxa27x suspend/resume struct confusion
The device data in ohci-pxa27x is a struct hcd, not a struct ohci_hcd. This correct the suspend/resume calls to account for this and adds some code to invalidate the platform data when the module is removed. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-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}