ARM: SAMSUNG: use spin_lock_irqsave() in clk_{enable,disable}
authorMinho Ban <mhban@samsung.com>
Fri, 20 Jan 2012 02:03:07 +0000 (11:03 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Sat, 11 Feb 2012 16:03:02 +0000 (01:03 +0900)
The clk_enable()and clk_disable() can be used process and ISR either.
And actually it is used for real product and other platforms use it
now. So spin_lock_irqsave() should be used instead.

Signed-off-by: Minho Ban <mhban@samsung.com>
Signed-off-by: Jaecheol Lee <jc.lee@samsung.com>
Signed-off-by: Sunyoung Kang <sy0816.kang@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/plat-samsung/clock.c

index 10f71179071f9b2db939764804401568309d801d..65c5eca475e76ef839a16aaef568173a2dc0ee1c 100644 (file)
@@ -84,31 +84,35 @@ static int clk_null_enable(struct clk *clk, int enable)
 
 int clk_enable(struct clk *clk)
 {
+       unsigned long flags;
+
        if (IS_ERR(clk) || clk == NULL)
                return -EINVAL;
 
        clk_enable(clk->parent);
 
-       spin_lock(&clocks_lock);
+       spin_lock_irqsave(&clocks_lock, flags);
 
        if ((clk->usage++) == 0)
                (clk->enable)(clk, 1);
 
-       spin_unlock(&clocks_lock);
+       spin_unlock_irqrestore(&clocks_lock, flags);
        return 0;
 }
 
 void clk_disable(struct clk *clk)
 {
+       unsigned long flags;
+
        if (IS_ERR(clk) || clk == NULL)
                return;
 
-       spin_lock(&clocks_lock);
+       spin_lock_irqsave(&clocks_lock, flags);
 
        if ((--clk->usage) == 0)
                (clk->enable)(clk, 0);
 
-       spin_unlock(&clocks_lock);
+       spin_unlock_irqrestore(&clocks_lock, flags);
        clk_disable(clk->parent);
 }