watchdog: xilinx: Move control_status_reg to functions
authorMichal Simek <michal.simek@xilinx.com>
Wed, 12 Feb 2014 13:34:33 +0000 (14:34 +0100)
committerWim Van Sebroeck <wim@iguana.be>
Mon, 31 Mar 2014 11:29:00 +0000 (13:29 +0200)
control_status_reg is temp variables and should be
used locally by specific function.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/of_xilinx_wdt.c

index 0e6c188f55ae7c867034217c022ac384ff8e485f..9cab3fd4f14c286c5fb521781d7fca4787d36f5e 100644 (file)
@@ -51,13 +51,14 @@ struct xwdt_device {
 static struct xwdt_device xdev;
 
 static  u32 timeout;
-static  u32 control_status_reg;
 static  u8  no_timeout;
 
 static  DEFINE_SPINLOCK(spinlock);
 
 static int xilinx_wdt_start(struct watchdog_device *wdd)
 {
+       u32 control_status_reg;
+
        spin_lock(&spinlock);
 
        /* Clean previous status and enable the watchdog timer */
@@ -76,6 +77,8 @@ static int xilinx_wdt_start(struct watchdog_device *wdd)
 
 static int xilinx_wdt_stop(struct watchdog_device *wdd)
 {
+       u32 control_status_reg;
+
        spin_lock(&spinlock);
 
        control_status_reg = ioread32(xdev.base + XWT_TWCSR0_OFFSET);
@@ -93,6 +96,8 @@ static int xilinx_wdt_stop(struct watchdog_device *wdd)
 
 static int xilinx_wdt_keepalive(struct watchdog_device *wdd)
 {
+       u32 control_status_reg;
+
        spin_lock(&spinlock);
 
        control_status_reg = ioread32(xdev.base + XWT_TWCSR0_OFFSET);