From patchwork Tue Feb 11 06:55:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3625251 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 769A19F2F6 for ; Tue, 11 Feb 2014 07:34:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D966B201F2 for ; Tue, 11 Feb 2014 07:34:40 +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 2406F201ED for ; Tue, 11 Feb 2014 07:34:39 +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 1WD7J0-0008B7-Sg; Tue, 11 Feb 2014 06:58:56 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WD7IB-0000XT-Rt; Tue, 11 Feb 2014 06:58:03 +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 1WD7H0-0000NG-An for linux-arm-kernel@lists.infradead.org; Tue, 11 Feb 2014 06:56:51 +0000 Received: by mail-ee0-f45.google.com with SMTP id b15so3322140eek.18 for ; Mon, 10 Feb 2014 22:56:29 -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=ew63LkVQ/pAakUV/kKRCkEO3uzKZ5iBhZjg1V2j8UmM=; b=Wg/Xrqy709z9HE8elMattYhNCHppaPxf4JPl3hqrF0sU5G/INydPjOA2AE9LQEY6jy yKn+l6uH+A6VHCIuvZrNllpRcLxTcADq4nw+k3zVE5ySn127DxmU98VYdeY9MR2FZwqa 3rTXAMhophcB5mG0n9I/ZvuSMgcRgp8RZioab622Zw82sgYqHgs4EnVuFWWMEcnElqcO 6kfTXhNfhk4vj4sYbqOx2g8mkWy39RAyq+yxgaowEMGZm0Oj2lCcfoUSoHJhcc7awhiY 15PK+hwJyS17oi7fOaPh1ZsxZyBoPTisvovCu3NChMefLte2n5+6FXE4/4LegxXrVbLP JnDg== X-Gm-Message-State: ALoCoQnbT/YjqgtB0aGe1R1RBd8r1JMT1EQF3V4pY/H0xjMHX9gZUgrasNeZXtY2saQNglUZBcuK X-Received: by 10.15.53.69 with SMTP id q45mr365037eew.108.1392101788708; Mon, 10 Feb 2014 22:56:28 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id k41sm63922480een.19.2014.02.10.22.56.27 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 10 Feb 2014 22:56:27 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH v2 11/11] watchdog: xilinx: Remove no_timeout variable Date: Tue, 11 Feb 2014 07:55:54 +0100 Message-Id: <52d86e3f2b957411deafbdfbd4bf93bb78f491ac.1392101734.git.michal.simek@xilinx.com> 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_015650_563891_46C81A06 X-CRM114-Status: GOOD ( 15.30 ) 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 Remove no_timeout variable and check variables directly. Suggested-by: Rob Herring Signed-off-by: Michal Simek Reviewed-by: Guenter Roeck --- 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 dad8fb5..fc91285 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); @@ -195,7 +190,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);