]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/musb/musb_core.c
ARM: OMAP: musb_vbus_store(): dont exit with spinlock held
[linux-2.6-omap-h63xx.git] / drivers / usb / musb / musb_core.c
index 8a60ac56a37c2cc3773248a8f4977a5e831b217c..9a73de521a868da4a8a464d965d21c94b8bc8ea2 100644 (file)
@@ -1712,11 +1712,12 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr,
        unsigned long   flags;
        unsigned long   val;
 
-       spin_lock_irqsave(&musb->lock, flags);
        if (sscanf(buf, "%lu", &val) < 1) {
                printk(KERN_ERR "Invalid VBUS timeout ms value\n");
                return -EINVAL;
        }
+
+       spin_lock_irqsave(&musb->lock, flags);
        musb->a_wait_bcon = val;
        if (musb->xceiv.state == OTG_STATE_A_WAIT_BCON)
                musb->is_active = 0;