From patchwork Wed Feb 12 13:34:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3638091 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 7752D9F369 for ; Wed, 12 Feb 2014 13:37:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A47EC2015D for ; Wed, 12 Feb 2014 13:37:03 +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 94C6220149 for ; Wed, 12 Feb 2014 13:37:02 +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 1WDZyy-0000bd-Hv; Wed, 12 Feb 2014 13:36:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDZyn-0003CB-BL; Wed, 12 Feb 2014 13:35:57 +0000 Received: from mail-ea0-f176.google.com ([209.85.215.176]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDZyV-00038C-7L for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2014 13:35:40 +0000 Received: by mail-ea0-f176.google.com with SMTP id b10so386213eae.21 for ; Wed, 12 Feb 2014 05:35:17 -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=cJejOaFktF0oAMrw6Xv8zK9DKq6VyPBwA4q0iIQotNY=; b=m/oGWUWsNMl7TsagONffDEoWjP5ivXuFinnUdtTUxt/4pnA2cjgT9lEGutRvkFJFRf BjPrULm5JG2X/PzjxqMMsMo0n+GWP3wWzdkqTYwL0qoLdEF342qteI8NUjeEf4jSlMEK MHPK4DzkQdMliVUWwnJZRdp98b5lLFTQMx3Vtavr8UBiC7KcA3ieN83nzQQXG4nxiF1d 0LkjkQ7rbQrDs1Nz+DVfiNlykAmae2JkEHXFbPQOHrYMtjH52IR2Yedye2YVEz6TmLhz fRuSkZBHxJaGXAGbJoE7vY7BdhUThLmXVwDMc78Q7VM/MX8TE7NbzQ2mddI2ycyefeh1 OLTg== X-Gm-Message-State: ALoCoQm2S9Lqj7xmBXHCI+wuo9DL93QcQ1QXFw2BLyurzAnciCICC8GII64I5u2PwBlDmI+SZqPx X-Received: by 10.14.175.2 with SMTP id y2mr3870235eel.75.1392212117429; Wed, 12 Feb 2014 05:35:17 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id y47sm81490292eel.14.2014.02.12.05.35.14 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 12 Feb 2014 05:35:15 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH v3 02/11] watchdog: xilinx: Move control_status_reg to functions Date: Wed, 12 Feb 2014 14:34:33 +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-20140212_083539_445076_6E8BA914 X-CRM114-Status: GOOD ( 13.72 ) 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 v3: None 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);