diff options
Diffstat (limited to 'drivers/usb/gadget/pxa2xx_udc.c')
-rw-r--r-- | drivers/usb/gadget/pxa2xx_udc.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c index ee9cd7869d9..91bf18b8191 100644 --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c @@ -2433,7 +2433,7 @@ static struct pxa2xx_udc memory = { /* * probe - binds to the platform device */ -static int __init pxa2xx_udc_probe(struct device *_dev) +static int __init pxa2xx_udc_probe(struct platform_device *pdev) { struct pxa2xx_udc *dev = &memory; int retval, out_dma = 1; @@ -2496,19 +2496,19 @@ static int __init pxa2xx_udc_probe(struct device *_dev) #endif /* other non-static parts of init */ - dev->dev = _dev; - dev->mach = _dev->platform_data; + dev->dev = &pdev->dev; + dev->mach = pdev->dev.platform_data; init_timer(&dev->timer); dev->timer.function = udc_watchdog; dev->timer.data = (unsigned long) dev; device_initialize(&dev->gadget.dev); - dev->gadget.dev.parent = _dev; - dev->gadget.dev.dma_mask = _dev->dma_mask; + dev->gadget.dev.parent = &pdev->dev; + dev->gadget.dev.dma_mask = pdev->dev.dma_mask; the_controller = dev; - dev_set_drvdata(_dev, dev); + platform_set_drvdata(pdev, dev); udc_disable(dev); udc_reinit(dev); @@ -2560,14 +2560,14 @@ lubbock_fail0: return 0; } -static void pxa2xx_udc_shutdown(struct device *_dev) +static void pxa2xx_udc_shutdown(struct platform_device *_dev) { pullup_off(); } -static int __exit pxa2xx_udc_remove(struct device *_dev) +static int __exit pxa2xx_udc_remove(struct platform_device *pdev) { - struct pxa2xx_udc *dev = dev_get_drvdata(_dev); + struct pxa2xx_udc *dev = platform_get_drvdata(pdev); udc_disable(dev); remove_proc_files(); @@ -2581,7 +2581,7 @@ static int __exit pxa2xx_udc_remove(struct device *_dev) free_irq(LUBBOCK_USB_DISC_IRQ, dev); free_irq(LUBBOCK_USB_IRQ, dev); } - dev_set_drvdata(_dev, NULL); + platform_set_drvdata(pdev, NULL); the_controller = NULL; return 0; } @@ -2602,9 +2602,9 @@ static int __exit pxa2xx_udc_remove(struct device *_dev) * VBUS IRQs should probably be ignored so that the PXA device just acts * "dead" to USB hosts until system resume. */ -static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) +static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state) { - struct pxa2xx_udc *udc = dev_get_drvdata(dev); + struct pxa2xx_udc *udc = platform_get_drvdata(dev); if (!udc->mach->udc_command) WARN("USB host won't detect disconnect!\n"); @@ -2613,9 +2613,9 @@ static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) return 0; } -static int pxa2xx_udc_resume(struct device *dev) +static int pxa2xx_udc_resume(struct platform_device *dev) { - struct pxa2xx_udc *udc = dev_get_drvdata(dev); + struct pxa2xx_udc *udc = platform_get_drvdata(dev); pullup(udc, 1); @@ -2629,27 +2629,28 @@ static int pxa2xx_udc_resume(struct device *dev) /*-------------------------------------------------------------------------*/ -static struct device_driver udc_driver = { - .name = "pxa2xx-udc", - .owner = THIS_MODULE, - .bus = &platform_bus_type, +static struct platform_driver udc_driver = { .probe = pxa2xx_udc_probe, .shutdown = pxa2xx_udc_shutdown, .remove = __exit_p(pxa2xx_udc_remove), .suspend = pxa2xx_udc_suspend, .resume = pxa2xx_udc_resume, + .driver = { + .owner = THIS_MODULE, + .name = "pxa2xx-udc", + }, }; static int __init udc_init(void) { printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); - return driver_register(&udc_driver); + return platform_driver_register(&udc_driver); } module_init(udc_init); static void __exit udc_exit(void) { - driver_unregister(&udc_driver); + platform_driver_unregister(&udc_driver); } module_exit(udc_exit); |