Received: by 10.223.164.202 with SMTP id h10csp2373935wrb; Sat, 18 Nov 2017 20:36:08 -0800 (PST) X-Google-Smtp-Source: AGs4zMbZKpz6Yw6ZOqq3cSRiT2rf4C5FoQuAO1i/syy3g9vWyxeDQNAXIcMk1uVhvbUN7RV/O7Vg X-Received: by 10.98.159.210 with SMTP id v79mr7031789pfk.162.1511066167897; Sat, 18 Nov 2017 20:36:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511066167; cv=none; d=google.com; s=arc-20160816; b=A+t9jqzqVjaez5ElNC5KjT3ybtwIAsDjVpXTsEhS4QcRnSCF8MkdSaTg22/nHx6lpT F28Va0u/pKDnKrhvIr3uIslE1wbYX7bhbbsoXwf2X8o6plhB1JB/qkXkLVNlmNAbpwhz 2bQNhSGZfQ4PyQFcSpqWWzyKDqJYqSl7goz82zmUpmZh9xbx/PeqbETFl5fStsUuqIz9 avS6V0cJsBTllM3zcemuNq5KUkkGW+s77poz11+UkKxs7z36GCmxSJS16W1id0jk52P/ 2PMCyuPs6HjsAdRZGh+BClxcq0R0Gt8emuz7GQCzZcnw2f+bLeHQJOFQU0ztWYltO9o+ uBiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=HiTqJ6zsi+tF9n/FMGMHrGK5AaViZtflnvNAYpsk2Po=; b=Ogx6AQbIDYZufj62cwDPx/H1ZcY32eS9WDpinXCHdZYG2IVB9qYDQ6sbFirIXfp/yS 6eWELmEok5t7df1bYkdLmRHLDUCf+2TrtyfIvs16VIwRkhuKZQUX5FwI+OJYX4+6d2bl 0AiwE6JVrzj7lb57Yl+9I3faWS97Hi74dQvRvnBX2v7AOWd3b3pS1f2r8y7UDaGoNCbK tWiPgWfdjJluyokGYeJII8YVQjwCeULvKkss4WMmCA+ch5d7NaD0cQ0rJw3dA9RcUA2N 3fVxrvMM8CczYgrSGBg17nzOVzrHRmfIjmWb9XBvzU9qeuebyE8wPG4bwdra7vqj5iNX V7ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZUuMhcSB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si1137620pls.46.2017.11.18.20.35.54; Sat, 18 Nov 2017 20:36:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZUuMhcSB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750905AbdKSEeR (ORCPT + 75 others); Sat, 18 Nov 2017 23:34:17 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:41109 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbdKSEeO (ORCPT ); Sat, 18 Nov 2017 23:34:14 -0500 Received: by mail-pf0-f196.google.com with SMTP id j28so4845762pfk.8 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=NIYh8XLEZs7jCtuEVFqDsit7Uk+y9DltsLuC3luLVk57JdDIkJ2egaF1o7WWuriR3/ S65m+8S2iAqQ7iJ3NwUAaqjuf2YR2ybHOp5vo2CfaEjEEzCBfkwODQ3PV8zKoi9qLffQ eELHFtqWp09duNFgrbvDwMhGOPNi+0XdAP82A8Ynaux6y7f02zz9XCDTGh132oLLET0b fu7UzZPUYsfmlV/U+kJSmRQhrrrFNAP1kQFENPDhDLJCzgv+xUXLR5loMO/DceLeQ728 7JYlQz5hV8SswMQAJKGrd4SxxRLbN9HwQ7pT4mTbGdSGRLnJPkeycVmwlUTu98WjzGK0 3ckw== X-Gm-Message-State: AJaThX7/k7tlcaxNYJP0XPndKmEIVLMSNvJr/wnKQmXWOdfavn5I9pK/ YoTVsa/rTRlUdpEToYQrf2A= 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4 From 1584604680703572003@xxx Mon Nov 20 16:53:05 +0000 2017 X-GM-THRID: 1583435451910066774 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread