]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
CBUS: Fix retu mutex handling
authorTony Lindgren <tony@atomide.com>
Sun, 11 May 2008 16:51:45 +0000 (09:51 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 15 May 2008 23:51:34 +0000 (16:51 -0700)
Fix retu mutex handling. Also use mutex_lock instead of unhandled
mutex_lock_interruptible.

Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/cbus/retu-wdt.c

index 63194d863672a5eca4d8541e019c4d1c0e880d22..85202ef1312dbfbc04fd33ee65b69b9c9c7f0257 100644 (file)
@@ -40,7 +40,7 @@
 #define RETU_WDT_MAX_TIMER 63
 
 static struct completion retu_wdt_completion;
-static DECLARE_MUTEX(retu_wdt_mutex);  /* Avoid simultaneous writes to watchdog register */
+static DEFINE_MUTEX(retu_wdt_mutex);
 
 static unsigned int period_val = RETU_WDT_DEFAULT_TIMER;       /* Current period of watchdog */
 static int counter_param = RETU_WDT_MAX_TIMER;
@@ -52,12 +52,12 @@ static int retu_modify_counter(unsigned int new)
        if (new < RETU_WDT_MIN_TIMER || new > RETU_WDT_MAX_TIMER)
                return -EINVAL;
 
-       down_interruptible(&retu_wdt_mutex);
+       mutex_lock(&retu_wdt_mutex);
 
        period_val = new;
        retu_write_reg(RETU_REG_WATCHDOG, (u16)period_val);
 
-       up(&retu_wdt_mutex);
+       mutex_unlock(&retu_wdt_mutex);
        return ret;
 }