clk: vt8500: Fix unbalanced spinlock in vt8500_dclk_set_rate()
authorTony Prisk <linux@prisktech.co.nz>
Fri, 17 May 2013 21:18:49 +0000 (09:18 +1200)
committerMike Turquette <mturquette@linaro.org>
Wed, 29 May 2013 23:13:58 +0000 (16:13 -0700)
With the addition of a DVO clock, a bug is now evident in the vt8500
clock code:
[    0.290000] WARNING: at init/main.c:698 do_one_initcall+0x158/0x18c()
[    0.300000] initcall wm8505fb_driver_init+0x0/0xc returned with disabled int

This is caused by an unbalanced spinlock in vt8500_dclk_set_rate().
Replace the second call to spin_lock_irqsave() with spin_unlock_irqrestore().

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/clk-vt8500.c

index debf688afa8e503c4dba690b5cfffe983c7abae0..553ac35bcc912ea9f975927f8f91ff1e680dec6d 100644 (file)
@@ -183,7 +183,7 @@ static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate,
        writel(divisor, cdev->div_reg);
        vt8500_pmc_wait_busy();
 
-       spin_lock_irqsave(cdev->lock, flags);
+       spin_unlock_irqrestore(cdev->lock, flags);
 
        return 0;
 }