rtc: m41t80: move m41t80_rtc_mutex to the block where it is used
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 9 Feb 2018 18:05:34 +0000 (19:05 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sat, 17 Mar 2018 13:20:47 +0000 (14:20 +0100)
Without CONFIG_RTC_DRV_M41T80_WDT the compiler complains:

|drivers/rtc/rtc-m41t80.c:76 ‘m41t80_rtc_mutex’ defined but not used [-Wunused-variable]

Move the variable to the block where it is used.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-m41t80.c

index 1103cdc33bfad2d721f815f5b6b8aa996d33f786..b3e33320c0bf8e24995b3162244defb4d523492a 100644 (file)
@@ -73,7 +73,6 @@
 #define M41T80_FEATURE_WD      BIT(3)  /* Extra watchdog resolution */
 #define M41T80_FEATURE_SQ_ALT  BIT(4)  /* RSx bits are in reg 4 */
 
-static DEFINE_MUTEX(m41t80_rtc_mutex);
 static const struct i2c_device_id m41t80_id[] = {
        { "m41t62", M41T80_FEATURE_SQ | M41T80_FEATURE_SQ_ALT },
        { "m41t65", M41T80_FEATURE_HT | M41T80_FEATURE_WD },
@@ -598,6 +597,7 @@ static struct clk *m41t80_sqw_register_clk(struct m41t80_data *m41t80)
  *
  *****************************************************************************
  */
+static DEFINE_MUTEX(m41t80_rtc_mutex);
 static struct i2c_client *save_client;
 
 /* Default margin */