aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/pxa2xx_udc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-11 12:24:26 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-11 12:24:26 -0500
commit5643f000c1e10ab991182478b76550e1364c3570 (patch)
tree950b2f61a5dd742de1c668ba968a9c8a99f1eab6 /drivers/usb/gadget/pxa2xx_udc.c
parent177294d19174cf92de22434bb1fc9a8ecdbbe658 (diff)
parent3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel
Diffstat (limited to 'drivers/usb/gadget/pxa2xx_udc.c')
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 510d28a924db..bb028c5b8952 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -2432,7 +2432,7 @@ static struct pxa2xx_udc memory = {
2432/* 2432/*
2433 * probe - binds to the platform device 2433 * probe - binds to the platform device
2434 */ 2434 */
2435static int __init pxa2xx_udc_probe(struct device *_dev) 2435static int __init pxa2xx_udc_probe(struct platform_device *pdev)
2436{ 2436{
2437 struct pxa2xx_udc *dev = &memory; 2437 struct pxa2xx_udc *dev = &memory;
2438 int retval, out_dma = 1; 2438 int retval, out_dma = 1;
@@ -2495,19 +2495,19 @@ static int __init pxa2xx_udc_probe(struct device *_dev)
2495#endif 2495#endif
2496 2496
2497 /* other non-static parts of init */ 2497 /* other non-static parts of init */
2498 dev->dev = _dev; 2498 dev->dev = &pdev->dev;
2499 dev->mach = _dev->platform_data; 2499 dev->mach = pdev->dev.platform_data;
2500 2500
2501 init_timer(&dev->timer); 2501 init_timer(&dev->timer);
2502 dev->timer.function = udc_watchdog; 2502 dev->timer.function = udc_watchdog;
2503 dev->timer.data = (unsigned long) dev; 2503 dev->timer.data = (unsigned long) dev;
2504 2504
2505 device_initialize(&dev->gadget.dev); 2505 device_initialize(&dev->gadget.dev);
2506 dev->gadget.dev.parent = _dev; 2506 dev->gadget.dev.parent = &pdev->dev;
2507 dev->gadget.dev.dma_mask = _dev->dma_mask; 2507 dev->gadget.dev.dma_mask = pdev->dev.dma_mask;
2508 2508
2509 the_controller = dev; 2509 the_controller = dev;
2510 dev_set_drvdata(_dev, dev); 2510 platform_set_drvdata(pdev, dev);
2511 2511
2512 udc_disable(dev); 2512 udc_disable(dev);
2513 udc_reinit(dev); 2513 udc_reinit(dev);
@@ -2559,14 +2559,14 @@ lubbock_fail0:
2559 return 0; 2559 return 0;
2560} 2560}
2561 2561
2562static void pxa2xx_udc_shutdown(struct device *_dev) 2562static void pxa2xx_udc_shutdown(struct platform_device *_dev)
2563{ 2563{
2564 pullup_off(); 2564 pullup_off();
2565} 2565}
2566 2566
2567static int __exit pxa2xx_udc_remove(struct device *_dev) 2567static int __exit pxa2xx_udc_remove(struct platform_device *pdev)
2568{ 2568{
2569 struct pxa2xx_udc *dev = dev_get_drvdata(_dev); 2569 struct pxa2xx_udc *dev = platform_get_drvdata(pdev);
2570 2570
2571 udc_disable(dev); 2571 udc_disable(dev);
2572 remove_proc_files(); 2572 remove_proc_files();
@@ -2580,7 +2580,7 @@ static int __exit pxa2xx_udc_remove(struct device *_dev)
2580 free_irq(LUBBOCK_USB_DISC_IRQ, dev); 2580 free_irq(LUBBOCK_USB_DISC_IRQ, dev);
2581 free_irq(LUBBOCK_USB_IRQ, dev); 2581 free_irq(LUBBOCK_USB_IRQ, dev);
2582 } 2582 }
2583 dev_set_drvdata(_dev, NULL); 2583 platform_set_drvdata(pdev, NULL);
2584 the_controller = NULL; 2584 the_controller = NULL;
2585 return 0; 2585 return 0;
2586} 2586}
@@ -2601,9 +2601,9 @@ static int __exit pxa2xx_udc_remove(struct device *_dev)
2601 * VBUS IRQs should probably be ignored so that the PXA device just acts 2601 * VBUS IRQs should probably be ignored so that the PXA device just acts
2602 * "dead" to USB hosts until system resume. 2602 * "dead" to USB hosts until system resume.
2603 */ 2603 */
2604static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) 2604static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state)
2605{ 2605{
2606 struct pxa2xx_udc *udc = dev_get_drvdata(dev); 2606 struct pxa2xx_udc *udc = platform_get_drvdata(dev);
2607 2607
2608 if (!udc->mach->udc_command) 2608 if (!udc->mach->udc_command)
2609 WARN("USB host won't detect disconnect!\n"); 2609 WARN("USB host won't detect disconnect!\n");
@@ -2612,9 +2612,9 @@ static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state)
2612 return 0; 2612 return 0;
2613} 2613}
2614 2614
2615static int pxa2xx_udc_resume(struct device *dev) 2615static int pxa2xx_udc_resume(struct platform_device *dev)
2616{ 2616{
2617 struct pxa2xx_udc *udc = dev_get_drvdata(dev); 2617 struct pxa2xx_udc *udc = platform_get_drvdata(dev);
2618 2618
2619 pullup(udc, 1); 2619 pullup(udc, 1);
2620 2620
@@ -2628,27 +2628,28 @@ static int pxa2xx_udc_resume(struct device *dev)
2628 2628
2629/*-------------------------------------------------------------------------*/ 2629/*-------------------------------------------------------------------------*/
2630 2630
2631static struct device_driver udc_driver = { 2631static struct platform_driver udc_driver = {
2632 .name = "pxa2xx-udc",
2633 .owner = THIS_MODULE,
2634 .bus = &platform_bus_type,
2635 .probe = pxa2xx_udc_probe, 2632 .probe = pxa2xx_udc_probe,
2636 .shutdown = pxa2xx_udc_shutdown, 2633 .shutdown = pxa2xx_udc_shutdown,
2637 .remove = __exit_p(pxa2xx_udc_remove), 2634 .remove = __exit_p(pxa2xx_udc_remove),
2638 .suspend = pxa2xx_udc_suspend, 2635 .suspend = pxa2xx_udc_suspend,
2639 .resume = pxa2xx_udc_resume, 2636 .resume = pxa2xx_udc_resume,
2637 .driver = {
2638 .owner = THIS_MODULE,
2639 .name = "pxa2xx-udc",
2640 },
2640}; 2641};
2641 2642
2642static int __init udc_init(void) 2643static int __init udc_init(void)
2643{ 2644{
2644 printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); 2645 printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION);
2645 return driver_register(&udc_driver); 2646 return platform_driver_register(&udc_driver);
2646} 2647}
2647module_init(udc_init); 2648module_init(udc_init);
2648 2649
2649static void __exit udc_exit(void) 2650static void __exit udc_exit(void)
2650{ 2651{
2651 driver_unregister(&udc_driver); 2652 platform_driver_unregister(&udc_driver);
2652} 2653}
2653module_exit(udc_exit); 2654module_exit(udc_exit);
2654 2655