X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fusb%2Fhost%2Fohci-sm501.c;h=e899a77dfb8340ae69e3502dcc8c5c2482a93a70;hb=1434b65731963207a4cc84bd87e6191e34321986;hp=a97070142869e69d1d79b6d3e0d17c690b047238;hpb=877c357e7511395bc923ec9efc2e8b021a17ed79;p=karo-tx-linux.git diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index a97070142869..e899a77dfb83 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 = { */ .hub_status_data = ohci_hub_status_data, .hub_control = ohci_hub_control, - .hub_irq_enable = ohci_rhsc_enable, #ifdef CONFIG_PM .bus_suspend = ohci_bus_suspend, .bus_resume = ohci_bus_resume, @@ -91,7 +90,7 @@ static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res, *mem; int retval, irq; - struct usb_hcd *hcd = 0; + struct usb_hcd *hcd = NULL; irq = retval = platform_get_irq(pdev, 0); if (retval < 0) @@ -199,7 +198,8 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev) usb_put_hcd(hcd); dma_release_declared_memory(&pdev->dev); mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); - release_mem_region(mem->start, mem->end - mem->start + 1); + if (mem) + release_mem_region(mem->start, mem->end - mem->start + 1); /* mask interrupts and disable power */ @@ -224,24 +224,26 @@ static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg) sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0); ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED; - dev->power.power_state = PMSG_SUSPEND; return 0; } static int ohci_sm501_resume(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(pdev)); + struct usb_hcd *hcd = platform_get_drvdata(pdev); + struct ohci_hcd *ohci = hcd_to_ohci(hcd); if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 1); - dev->power.power_state = PMSG_ON; - usb_hcd_resume_root_hub(platform_get_drvdata(pdev)); + ohci_finish_controller_resume(hcd); return 0; } +#else +#define ohci_sm501_suspend NULL +#define ohci_sm501_resume NULL #endif /*-------------------------------------------------------------------------*/ @@ -253,12 +255,11 @@ static struct platform_driver ohci_hcd_sm501_driver = { .probe = ohci_hcd_sm501_drv_probe, .remove = ohci_hcd_sm501_drv_remove, .shutdown = usb_hcd_platform_shutdown, -#ifdef CONFIG_PM .suspend = ohci_sm501_suspend, .resume = ohci_sm501_resume, -#endif .driver = { .owner = THIS_MODULE, .name = "sm501-usb", }, }; +MODULE_ALIAS("platform:sm501-usb");