From patchwork Tue Feb 11 06:55:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3625121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 09B0E9F2F6 for ; Tue, 11 Feb 2014 06:57:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29B082016C for ; Tue, 11 Feb 2014 06:57:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C6DC201FA for ; Tue, 11 Feb 2014 06:57:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WD7Gz-00075z-1t; Tue, 11 Feb 2014 06:56:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WD7Gr-0000Oo-49; Tue, 11 Feb 2014 06:56:41 +0000 Received: from mail-ee0-f45.google.com ([74.125.83.45]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WD7Gc-0000Lr-Mb for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2014 06:56:29 +0000 Received: by mail-ee0-f45.google.com with SMTP id b15so3321919eek.18 for ; Mon, 10 Feb 2014 22:56:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:content-type; bh=zD8/7UuT339cD91L7bS6hsDESTde/vpy+7MpIIpguts=; b=C3M1jXK6ouW/YnTwWsJi9++cF+AT1aTXxTekilaMQSrOA3v0nULgIb0pUM/yjNW6so QybLlbzVvCcFqDODh1lZZGDafcvsf/4veRfIHs+snVdFk3zOcPCRy8+Iw5aC4Af0uipu C/Wi6/14iTWO7v9wbdGALwVqUMrEZKzFsr/tTHnuDQPMO0LThScJpVrc48xAbIxXcvuc NC7Rxs2FsvuylXlvY8AQHRczj+9+9nPN+BprRGNfD+kK+pPu5jgzy2qZDRwQ7mu0xq1E YAgxTw1QAB0mU5iP39cyqAkB5d9cwOqaNYQViZQZNVhUxmWQnqVss6Yj3ytuwXPDDiyw QRuQ== X-Gm-Message-State: ALoCoQn2dSOSkfU1TSHuuMmMP0zIu6zzD2w6YlkcVZCTgc99RG4NTVmr5KrYyP+zzDwToOM6jJF/ X-Received: by 10.15.102.78 with SMTP id bq54mr718754eeb.94.1392101762022; Mon, 10 Feb 2014 22:56:02 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id d9sm63592816eei.9.2014.02.10.22.56.00 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 10 Feb 2014 22:56:00 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH v2 02/11] watchdog: xilinx: Move control_status_reg to functions Date: Tue, 11 Feb 2014 07:55:45 +0100 Message-Id: X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140211_015626_914700_EAB4E7D3 X-CRM114-Status: GOOD ( 13.69 ) X-Spam-Score: -1.9 (-) Cc: linux-arm-kernel@lists.infradead.org, Wim Van Sebroeck , linux-watchdog@vger.kernel.org, Guenter Roeck X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP control_status_reg is temp variables and should be used locally by specific function. Signed-off-by: Michal Simek Reviewed-by: Guenter Roeck --- Changes in v2: None drivers/watchdog/of_xilinx_wdt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 1.8.2.3 diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 8c2814e..aca9bab 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -52,13 +52,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 */ @@ -77,6 +78,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); @@ -94,6 +97,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);