From patchwork Sun Nov 19 04:34:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10065037 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 8F8C7602B7 for ; Sun, 19 Nov 2017 04:49:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77DE228FF5 for ; Sun, 19 Nov 2017 04:49:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58D8B2905E; Sun, 19 Nov 2017 04:49:09 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D73A728FF5 for ; Sun, 19 Nov 2017 04:49:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NXU1yVkNmh2OCAOYryibAx/LGOw6ttW80wB6ZZT+MYE=; b=W57u+jrpZNGYVO+fkeVPjvnpWe WFnrlw2ExDeU7GcZW/qAgzzlHWoR+7kZdyLZvq+seoYh6/ibLWaEDcAdMrfm/2hAvvwLKvz7Yq/3C ke+SCyB3lY6QWN+J7AWIgAKpi53XYZ4V0C+h/EGS2Ych92uVkXM5UI5XZ4IjkNBoMLYYLD3PrYWZw 9kW0IgO8k/IKA+lXrSJ5UzIcKrQjGdKrwL8Gg+tfSSRQsgwMhZ6MC/xncsee26ijNRAO8CwS6nhUd cDnqDqSdrcf77sfcDaJQRjnlMTSA2BOyy8jf/3jN1dkwIInpTuA/AvXpZh4O6vPmVAVvPmYJtOMf9 nf1xx83g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eGHXS-00068l-9V; Sun, 19 Nov 2017 04:49:02 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eGHJS-0000Uk-Lk for linux-arm-kernel@lists.infradead.org; Sun, 19 Nov 2017 04:34:37 +0000 Received: by mail-pf0-x242.google.com with SMTP id r88so905626pfi.2 for ; Sat, 18 Nov 2017 20:34:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=HiTqJ6zsi+tF9n/FMGMHrGK5AaViZtflnvNAYpsk2Po=; b=ZUuMhcSBD1tOHNKXa/niWElydAVQ6wnvOO0IHDdc5PU8rV61dV7VcWBkHh7jZHlssY DPpvLaBtT1xdDyo6AzI3U9EspSgys4s3yewL3fPtRbtRAkUK4WXGWAf+clTd5uqEq/Yz c8S4VyFEpuJkJYx66JxGY7yHaZAAH7yk3NgfPEKhj2fzF37TNdn+3j8YMrGeVKMRsquh z7u+6hC7Khpfm52dP0mDDWIkXk2TyDwhBOxl3afQdUOyGkdJyDJXnlR4XqlV4k/FWaj/ qF5joUWTU1foX8FMTTUEonSVSPUXRNtx48HsGWr6ZLikeU0g+bouUi9I6C6LLYNa6xVc 4hvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=HiTqJ6zsi+tF9n/FMGMHrGK5AaViZtflnvNAYpsk2Po=; b=SxLD/YXUoXp0CsDtnvBgos1SVB0Hnc6gxps5EnCIqXucrG/TNBWaAyXGzFVqanqMIN xTMFHSmXcffDhlx+ItDKBW6CF3beyvUZuhGz5kiTZLCEUk6GJPLBk9bVQTDZizazfM4r aw8x2rxI+X5OE5zFViBbKNIhNQmGRZ3Ni3A45tgmMu57Ykoi6MD0uLkNx0/BGb755Eff J1WylkNDTWIDXfad4J8sM73lBbrv7rsg/DO0JJIIn9GfEz92WqiduakzJjZHOetgbRMc A0oLtjwV11vIYyCADbnOB0+yYiaEoAY0k5ZMDCgoY0d17E6KXDkNe0e+vElEt78IRY6A oPyA== X-Gm-Message-State: AJaThX51q8IJiEmaMVrAg8GRF/0wVX6Uylx7kaqgyGUe1hbi625git0e 9+Z8TEw7X4AAvBLV5XjFJYI= X-Google-Smtp-Source: AGs4zMYosg3jmZbDRG1CtW9fV3GEQw1a2PGRkOe07mREYxxDR+LUtk6+4s+s4OqbqCkP1sueGy057g== X-Received: by 10.99.60.26 with SMTP id j26mr9590211pga.256.1511066054136; Sat, 18 Nov 2017 20:34:14 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id u68sm13955257pfu.154.2017.11.18.20.34.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:34:13 -0800 (PST) From: Arvind Yadav To: arnd@arndb.de, gregkh@linuxfoundation.org, joel@jms.id.au, nicolas.ferre@microchip.com, alexandre.belloni@free-electrons.com, linux@armlinux.org.uk Subject: [PATCH 2/2 v3] misc: atmel-ssc: Fix platform_get_irq's error checking Date: Sun, 19 Nov 2017 10:04:01 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: <3ce95a4e4eb4476b19868f36cd1f11e4b62b6203.1511065797.git.arvind.yadav.cs@gmail.com> References: <3ce95a4e4eb4476b19868f36cd1f11e4b62b6203.1511065797.git.arvind.yadav.cs@gmail.com> In-Reply-To: <3ce95a4e4eb4476b19868f36cd1f11e4b62b6203.1511065797.git.arvind.yadav.cs@gmail.com> References: <3ce95a4e4eb4476b19868f36cd1f11e4b62b6203.1511065797.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_203434_893694_5E867ED7 X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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 The platform_get_irq() function returns negative if an error occurs. zero or positive number on success. platform_get_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav --- changes in v2 : Add failure case '<= 0' instead of '< 0'. IRQ 0 is not valid. changes in v3: Return -ENODEV instead of ssc->irq. drivers/misc/atmel-ssc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index b2a0340..2ec0f9e 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -235,7 +235,7 @@ static int ssc_probe(struct platform_device *pdev) clk_disable_unprepare(ssc->clk); ssc->irq = platform_get_irq(pdev, 0); - if (!ssc->irq) { + if (ssc->irq <= 0) { dev_dbg(&pdev->dev, "could not get irq\n"); return -ENXIO; }