usb: r8a66597-udc: fix spinlock usage
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Mon, 4 Apr 2011 04:09:22 +0000 (13:09 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 13 Apr 2011 22:44:00 +0000 (15:44 -0700)
Because the disconnect function in the composite driver will call spin_lock,
this driver has to call spin_unlock before calling driver->disconnet().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/r8a66597-udc.c

index 015118535f77db3e8418909b850dfb0ed576fd00..6dcc1f68fa6041531e73eed8104d5c1acff1338b 100644 (file)
@@ -1083,7 +1083,9 @@ static void irq_device_state(struct r8a66597 *r8a66597)
 
        if (dvsq == DS_DFLT) {
                /* bus reset */
+               spin_unlock(&r8a66597->lock);
                r8a66597->driver->disconnect(&r8a66597->gadget);
+               spin_lock(&r8a66597->lock);
                r8a66597_update_usb_speed(r8a66597);
        }
        if (r8a66597->old_dvsq == DS_CNFG && dvsq != DS_CNFG)