]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/gadget/pxa2xx_udc.c
Pull acpica into release branch
[linux-2.6-omap-h63xx.git] / drivers / usb / gadget / pxa2xx_udc.c
index 510d28a924db95501edb3c69402148a9df208ea3..680f7fc5b1717addba266f385e33a7b209ee1d7e 100644 (file)
@@ -335,11 +335,10 @@ pxa2xx_ep_alloc_request (struct usb_ep *_ep, gfp_t gfp_flags)
 {
        struct pxa2xx_request *req;
 
-       req = kmalloc (sizeof *req, gfp_flags);
+       req = kzalloc(sizeof(*req), gfp_flags);
        if (!req)
                return NULL;
 
-       memset (req, 0, sizeof *req);
        INIT_LIST_HEAD (&req->queue);
        return &req->req;
 }
@@ -2432,7 +2431,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;
@@ -2495,19 +2494,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);
@@ -2559,14 +2558,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();
@@ -2580,7 +2579,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;
 }
@@ -2601,9 +2600,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");
@@ -2612,9 +2611,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);
 
@@ -2628,27 +2627,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);