From patchwork Wed Jan 4 03:25:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9496071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7C093606B4 for ; Wed, 4 Jan 2017 03:28:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EBD027829 for ; Wed, 4 Jan 2017 03:28:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63C0027CFC; Wed, 4 Jan 2017 03:28:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, SUSPICIOUS_RECIPS, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1110627829 for ; Wed, 4 Jan 2017 03:28:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOcE3-0002Cj-FL; Wed, 04 Jan 2017 03:26:55 +0000 Received: from bh-25.webhostbox.net ([208.91.199.152]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cOcDx-00028E-BZ for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2017 03:26:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=9z690vL3gzfL8GJVmp5lIFCvPvtIvTEsJUJouvGBxHc=; b=O1POixRAN6MBYsyQ4ECLqDUxvr iPweYWPqtCuNyoAAugF0ue7PYPTRfo0+aa4fj3X6inRqsSwyDN3Cn1eSiwYU8CLI47DgcJQqCzEBl A+f0KOVs+D9V8UHKRCY6I98SbCPyZ+kt5mEb0GGFbqdOY9DqqfTw3SWLfl3dt6PCoN6rvf7UPvppy unc0SoqnIjcsJK/eiK50QxiJdAzyvvvNouX43z2njVsVVSm1EemfxAk4cjFgGTwGkW8iyjFDwWi02 xLHxPVC5sIl49gKCNAgY70ba/6Pni1NI2bXq7+IBQt2clay578GZ50LV/EaYWteYH9K0CZ+ptB7OR BJaRr2AQ==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:55226 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cOcCx-002qek-Al; Wed, 04 Jan 2017 03:25:47 +0000 From: Guenter Roeck To: Linus Walleij Subject: [PATCH 1/4] watchdog: coh901327_wdt: Simplify error handling in probe function Date: Tue, 3 Jan 2017 19:25:40 -0800 Message-Id: <1483500343-27113-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=1.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170103_192649_531761_F623FD8A X-CRM114-Status: UNSURE ( 7.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Checking if there is no error followed by a goto if there is one is confusing. Reverse the logic. Signed-off-by: Guenter Roeck Reviewed-by: Linus Walleij --- drivers/watchdog/coh901327_wdt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c index a099b77fc0b9..dc97b2fd6c49 100644 --- a/drivers/watchdog/coh901327_wdt.c +++ b/drivers/watchdog/coh901327_wdt.c @@ -360,12 +360,10 @@ static int __init coh901327_probe(struct platform_device *pdev) coh901327_wdt.parent = &pdev->dev; ret = watchdog_register_device(&coh901327_wdt); - if (ret == 0) - dev_info(&pdev->dev, - "initialized. timer margin=%d sec\n", margin); - else + if (ret) goto out_no_wdog; + dev_info(&pdev->dev, "initialized. timer margin=%d sec\n", margin); return 0; out_no_wdog: