From patchwork Wed Feb 12 13:41:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3638261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 00898BF13A for ; Wed, 12 Feb 2014 13:45:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1212720145 for ; Wed, 12 Feb 2014 13:45:47 +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 1605020142 for ; Wed, 12 Feb 2014 13:45:46 +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 1WDa6M-0003jr-Ki; Wed, 12 Feb 2014 13:43:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDa5r-0003YV-Bg; Wed, 12 Feb 2014 13:43:15 +0000 Received: from mail-ee0-f47.google.com ([74.125.83.47]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WDa5Q-0003TS-E4 for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2014 13:42:49 +0000 Received: by mail-ee0-f47.google.com with SMTP id d49so4340806eek.34 for ; Wed, 12 Feb 2014 05:42:26 -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=qdo+MkPOMmY9BB4jvhRNhXVShAbWYzSg5GhQcQSjSFw=; b=cTPv3P8vYuNUJQj4E1GBAO3q0XkkaLndVZkXsi+vY7P/gUitZPiljnuwaBeaKJEAzt /2c18eGGvaGMrXks+MBgDMaah3+HDurpMO+uGXPLqkmDjzeBO0OOMNomMCvLFetjre1h DME60xpjE6ZmaT9t1nentjNhTvTOO0+Qth2RkNRCyZeHOG9esY9yoPmzl04WAI7bUs0u /qzraZyYg5rqgALAUwNrvUP/+hyYXTlt/5CG3uFzxUWfLRvSQGvjgBcMjkRFUQmokCnY pLfe/28Zh6iKurwY1tSPY4UBHbzHMtPx7od/cYT5mfBcJ3Xlo0aVClkivDIgQLsf2wJ1 AKYQ== X-Gm-Message-State: ALoCoQlNo9KB/bHZeXQGl/ifMHewLTIRwOrUhZeX1pCQ1jh7Pmdv+mTuqkBpNf/VKiI6UycgWUHT X-Received: by 10.14.8.194 with SMTP id 42mr4045847eer.16.1392212546751; Wed, 12 Feb 2014 05:42:26 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id m1sm81076004een.7.2014.02.12.05.42.22 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 12 Feb 2014 05:42:24 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH v3 11/11] watchdog: xilinx: Remove no_timeout variable Date: Wed, 12 Feb 2014 14:41:25 +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_084248_655909_6326AAB3 X-CRM114-Status: GOOD ( 15.14 ) X-Spam-Score: -1.9 (-) Cc: linux-arm-kernel@lists.infradead.org, wim@iguana.be, linux-watchdog@vger.kernel.org, linux@roeck-us.net 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 Remove no_timeout variable and check variables directly. Suggested-by: Rob Herring Signed-off-by: Michal Simek Reviewed-by: Guenter Roeck --- Changes in v3: None Changes in v2: - New patch in this series drivers/watchdog/of_xilinx_wdt.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) -- 1.8.2.3 diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 9dd16cf..c7fb85e 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -147,10 +147,9 @@ static u32 xwdt_selftest(struct xwdt_device *xdev) static int xwdt_probe(struct platform_device *pdev) { int rc; - u32 pfreq, enable_once = 0; + u32 pfreq = 0, enable_once = 0; struct resource *res; struct xwdt_device *xdev; - bool no_timeout = false; struct watchdog_device *xilinx_wdt_wdd; xdev = devm_kzalloc(&pdev->dev, sizeof(*xdev), GFP_KERNEL); @@ -168,19 +167,15 @@ static int xwdt_probe(struct platform_device *pdev) return PTR_ERR(xdev->base); rc = of_property_read_u32(pdev->dev.of_node, "clock-frequency", &pfreq); - if (rc) { + if (rc) dev_warn(&pdev->dev, "The watchdog clock frequency cannot be obtained\n"); - no_timeout = true; - } rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-interval", &xdev->wdt_interval); - if (rc) { + if (rc) dev_warn(&pdev->dev, "Parameter \"xlnx,wdt-interval\" not found\n"); - no_timeout = true; - } rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-enable-once", &enable_once); @@ -194,7 +189,7 @@ static int xwdt_probe(struct platform_device *pdev) * Twice of the 2^wdt_interval / freq because the first wdt overflow is * ignored (interrupt), reset is only generated at second wdt overflow */ - if (!no_timeout) + if (pfreq && xdev->wdt_interval) xilinx_wdt_wdd->timeout = 2 * ((1 << xdev->wdt_interval) / pfreq);