diff options
Diffstat (limited to 'drivers/usb/host/ohci-sm501.c')
| -rw-r--r-- | drivers/usb/host/ohci-sm501.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index 4ea92762fb28..77204f001b9a 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c | |||
| @@ -75,7 +75,6 @@ static const struct hc_driver ohci_sm501_hc_driver = { | |||
| 75 | */ | 75 | */ |
| 76 | .hub_status_data = ohci_hub_status_data, | 76 | .hub_status_data = ohci_hub_status_data, |
| 77 | .hub_control = ohci_hub_control, | 77 | .hub_control = ohci_hub_control, |
| 78 | .hub_irq_enable = ohci_rhsc_enable, | ||
| 79 | #ifdef CONFIG_PM | 78 | #ifdef CONFIG_PM |
| 80 | .bus_suspend = ohci_bus_suspend, | 79 | .bus_suspend = ohci_bus_suspend, |
| 81 | .bus_resume = ohci_bus_resume, | 80 | .bus_resume = ohci_bus_resume, |
| @@ -199,7 +198,8 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev) | |||
| 199 | usb_put_hcd(hcd); | 198 | usb_put_hcd(hcd); |
| 200 | dma_release_declared_memory(&pdev->dev); | 199 | dma_release_declared_memory(&pdev->dev); |
| 201 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 200 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
| 202 | release_mem_region(mem->start, mem->end - mem->start + 1); | 201 | if (mem) |
| 202 | release_mem_region(mem->start, mem->end - mem->start + 1); | ||
| 203 | 203 | ||
| 204 | /* mask interrupts and disable power */ | 204 | /* mask interrupts and disable power */ |
| 205 | 205 | ||
| @@ -224,24 +224,26 @@ static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg) | |||
| 224 | 224 | ||
| 225 | sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0); | 225 | sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0); |
| 226 | ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED; | 226 | ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED; |
| 227 | dev->power.power_state = PMSG_SUSPEND; | ||
| 228 | return 0; | 227 | return 0; |
| 229 | } | 228 | } |
| 230 | 229 | ||
| 231 | static int ohci_sm501_resume(struct platform_device *pdev) | 230 | static int ohci_sm501_resume(struct platform_device *pdev) |
| 232 | { | 231 | { |
| 233 | struct device *dev = &pdev->dev; | 232 | struct device *dev = &pdev->dev; |
| 234 | struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(pdev)); | 233 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 234 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); | ||
| 235 | 235 | ||
| 236 | if (time_before(jiffies, ohci->next_statechange)) | 236 | if (time_before(jiffies, ohci->next_statechange)) |
| 237 | msleep(5); | 237 | msleep(5); |
| 238 | ohci->next_statechange = jiffies; | 238 | ohci->next_statechange = jiffies; |
| 239 | 239 | ||
| 240 | sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 1); | 240 | sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 1); |
| 241 | dev->power.power_state = PMSG_ON; | 241 | ohci_finish_controller_resume(hcd); |
| 242 | usb_hcd_resume_root_hub(platform_get_drvdata(pdev)); | ||
| 243 | return 0; | 242 | return 0; |
| 244 | } | 243 | } |
| 244 | #else | ||
| 245 | #define ohci_sm501_suspend NULL | ||
| 246 | #define ohci_sm501_resume NULL | ||
| 245 | #endif | 247 | #endif |
| 246 | 248 | ||
| 247 | /*-------------------------------------------------------------------------*/ | 249 | /*-------------------------------------------------------------------------*/ |
| @@ -253,10 +255,8 @@ static struct platform_driver ohci_hcd_sm501_driver = { | |||
| 253 | .probe = ohci_hcd_sm501_drv_probe, | 255 | .probe = ohci_hcd_sm501_drv_probe, |
| 254 | .remove = ohci_hcd_sm501_drv_remove, | 256 | .remove = ohci_hcd_sm501_drv_remove, |
| 255 | .shutdown = usb_hcd_platform_shutdown, | 257 | .shutdown = usb_hcd_platform_shutdown, |
| 256 | #ifdef CONFIG_PM | ||
| 257 | .suspend = ohci_sm501_suspend, | 258 | .suspend = ohci_sm501_suspend, |
| 258 | .resume = ohci_sm501_resume, | 259 | .resume = ohci_sm501_resume, |
| 259 | #endif | ||
| 260 | .driver = { | 260 | .driver = { |
| 261 | .owner = THIS_MODULE, | 261 | .owner = THIS_MODULE, |
| 262 | .name = "sm501-usb", | 262 | .name = "sm501-usb", |
