From: Michal Simek Date: Wed, 12 Feb 2014 13:34:33 +0000 (+0100) Subject: watchdog: xilinx: Move control_status_reg to functions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5cf4e69d39f6a31a5305d01690c1607356b1483b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git watchdog: xilinx: Move control_status_reg to functions control_status_reg is temp variables and should be used locally by specific function. Signed-off-by: Michal Simek Reviewed-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 0e6c188f55ae..9cab3fd4f14c 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -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);