Merge branch 'master' into upstream
[pandora-kernel.git] / drivers / usb / gadget / pxa2xx_udc.c
index 1ed506e..27904a5 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/timer.h>
@@ -56,7 +55,7 @@
 #include <asm/arch/pxa-regs.h>
 #endif
 
-#include <linux/usb_ch9.h>
+#include <linux/usb/ch9.h>
 #include <linux/usb_gadget.h>
 
 #include <asm/arch/udc.h>
@@ -1623,7 +1622,6 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
        if (!driver
                        || driver->speed < USB_SPEED_FULL
                        || !driver->bind
-                       || !driver->unbind
                        || !driver->disconnect
                        || !driver->setup)
                return -EINVAL;
@@ -1694,7 +1692,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
 
        if (!dev)
                return -ENODEV;
-       if (!driver || driver != dev->driver)
+       if (!driver || driver != dev->driver || !driver->unbind)
                return -EINVAL;
 
        local_irq_disable();
@@ -2615,7 +2613,7 @@ lubbock_fail0:
 #endif
        if (vbus_irq) {
                retval = request_irq(vbus_irq, udc_vbus_irq,
-                               SA_INTERRUPT | SA_SAMPLE_RANDOM,
+                               IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
                                driver_name, dev);
                if (retval != 0) {
                        printk(KERN_ERR "%s: can't get irq %i, err %d\n",
@@ -2638,9 +2636,11 @@ static int __exit pxa2xx_udc_remove(struct platform_device *pdev)
 {
        struct pxa2xx_udc *dev = platform_get_drvdata(pdev);
 
+       if (dev->driver)
+               return -EBUSY;
+
        udc_disable(dev);
        remove_proc_files();
-       usb_gadget_unregister_driver(dev->driver);
 
        if (dev->got_irq) {
                free_irq(IRQ_USB, dev);