usb: dwc3: omap: remove unnecessary lock
authorFelipe Balbi <balbi@ti.com>
Sat, 7 Dec 2013 17:54:19 +0000 (11:54 -0600)
committerFelipe Balbi <balbi@ti.com>
Mon, 9 Dec 2013 16:01:40 +0000 (10:01 -0600)
the lock was only taken inside the hardirq
handler, which runs with IRQs disabled. There's
no chance of any race condition happening, even
on SMP machines. It's safe to remove that
spinlock.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/dwc3-omap.c

index daab0ad10b25c32a5d30d406b53df5a3d256185e..b269dbd47fc41edef682380bcd3637a20371b9ee 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
-#include <linux/spinlock.h>
 #include <linux/platform_device.h>
 #include <linux/platform_data/dwc3-omap.h>
 #include <linux/pm_runtime.h>
 #define USBOTGSS_UTMI_OTG_STATUS_VBUSVALID     (1 << 1)
 
 struct dwc3_omap {
-       /* device lock */
-       spinlock_t              lock;
-
        struct device           *dev;
 
        int                     irq;
@@ -280,8 +276,6 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
        struct dwc3_omap        *omap = _omap;
        u32                     reg;
 
-       spin_lock(&omap->lock);
-
        reg = dwc3_omap_read_irqmisc_status(omap);
 
        if (reg & USBOTGSS_IRQMISC_DMADISABLECLR) {
@@ -322,8 +316,6 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap)
 
        dwc3_omap_write_irq0_status(omap, reg);
 
-       spin_unlock(&omap->lock);
-
        return IRQ_HANDLED;
 }
 
@@ -449,8 +441,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)
                }
        }
 
-       spin_lock_init(&omap->lock);
-
        omap->dev       = dev;
        omap->irq       = irq;
        omap->base      = base;