Received: by 10.223.164.202 with SMTP id h10csp2348872wrb; Sat, 18 Nov 2017 19:54:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMb+d6oAUCIpHJM8E2VOCSpW7lBci6XV+oBtyaPlv5j/TunKWb34p7Rd5XszFrcRKPkVI+h0 X-Received: by 10.99.171.77 with SMTP id k13mr9705517pgp.229.1511063690116; Sat, 18 Nov 2017 19:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511063690; cv=none; d=google.com; s=arc-20160816; b=lopZrxBtqwdqW17CAV5Y/LtMmBrrQGrKQjhlkRsZwndG6+uBLZOOy5xGOgYf88Y9MH JRgsmSOYAdiJ+v1WJzTg4GYfFgOFpHos4CqVgpwzDdAPO3ao77SRECeztBdR26+Ta+bq jsC+uDM54objqOBsvCtsEpvIlSVP0Gv3BnIfUPjB1wAEuiAr//Sb5QZVYm5Y/0Aozp0I Y/1s2TJlxkcbt2poJECk/7+9Hl57GJNtqDKwkVbTwe2mh58GnnJ8R+kNF8eC0iUcdQkC +HGOFsDC2pAAroFgWQbbc+eLjCUsVv39qF5L1YtqzET67yPhQm34rDT2dGojXDBPHKrT 5y6w== 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=bxo9z9GZJJZszU9YdinlLSZQzy7n9Mpk+lCSr2BBfO4=; b=xLitvt4Ig4Z6VVaYlTHDD8ysluiaoFZ8J+7BW9UlmnihzLMNIxvDjSmRPbA6AHX8WG FVbW74mO7e6aRp8vlwIk+VIucJmu7xuCUqw1yG7rfASmgkkghDM36rE16cKYW4Ze0Ykr YfnSl7X7dmc1VvCOpeIVRRT4ZqD6jMipJEsEdaAtyLyoXSpNgg9gdPmXCS8CHOauglO7 vcE5iXltu8vjClfoHktDUSGBbpVMN46prgxfRWR5EuUFKn+b92qqcj2ZXdZY1s+d9vNu TrRtxhG4jfatNSTmZGfVoDz+l5o1YR4vvPGKL5slz61Y13weNPJjr3u1ICrDWbjmB5ZH StZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FQcmPNBO; 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 f68si5436224pgc.400.2017.11.18.19.54.37; Sat, 18 Nov 2017 19:54:50 -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=FQcmPNBO; 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 S1946152AbdKRJMu (ORCPT + 93 others); Sat, 18 Nov 2017 04:12:50 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46170 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163092AbdKRJLV (ORCPT ); Sat, 18 Nov 2017 04:11:21 -0500 Received: by mail-pf0-f193.google.com with SMTP id q4so3695072pfg.13 for ; Sat, 18 Nov 2017 01:11:21 -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=bxo9z9GZJJZszU9YdinlLSZQzy7n9Mpk+lCSr2BBfO4=; b=FQcmPNBOzVuH/I/kY415aqsl+9+3zGtD8tzoAbXXj5QmjDthvFlpor95Eg427Cd2aq H66YABlXl2bVZBJMhVkwBXxQG882irrnp22tTliNTwj/8YjtaW1lX19J6VWLb+nZFnRL 4+RzM2Zcs7iZXe5ZZ6Dx9+QLuy8PPyZdTxC3TPBlfup6SkzpR9bgQ5rP/vcrdvMt8bwI d6MaEtjMdSW5RaiJFDztLmr7e+ZNequX+rD1yNp4zQlO+UaSmiVe4mxLQmfS8vg56NR/ vMLvkcRXLlnZ8vQE+rT8sGGh3WGwrW5r81vRTiui3GD7m9y5CQP+9SDN2wuujORozFwU D2rg== 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=bxo9z9GZJJZszU9YdinlLSZQzy7n9Mpk+lCSr2BBfO4=; b=OrCd/LX9Br9M9+INB5fv9lxrtw/2k0vLPo20tUHItd6c21BzPs5PMG0Y36kuJNXpgm 80+8Xfhom5zKBgc/U3Eqr7Nn3/yeRUEgIon0cJqetqBfKhneA7R2MG5X9Z27CQL1rZ7Y Jz6VOVyarQgvdVLbB3oZaP+xylLx8108zLPAxRmUBjChe8kFuTWZAuRU8PSkzB6+FiTu ugi46QGyOCjF8HL2s9H8JAcVIofgkYKR8XnzP9tEZETITqD7iXkBELv6q0um/ImSg2oz Kulgjst2WN62jtTAjUcQnvjubIFm8fR/r9a/bCkbb3SjnFNmnwzFfZviZzSaom+eR6QA 7Lhw== X-Gm-Message-State: AJaThX5L5k4LkCTPG0qqhjWMqgSlpXKfRdqhhKy2JWd7rHwAG9d3BlZn NMj4fRJPgML+BzCqUcnidbA= X-Received: by 10.84.177.131 with SMTP id x3mr7746293plb.327.1510996281197; Sat, 18 Nov 2017 01:11:21 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id h81sm11158803pfh.119.2017.11.18.01.11.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:11:20 -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 v2] misc: atmel-ssc: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 14:40:13 +0530 Message-Id: <03c6f3e9df6d3077717e1f14b4775f2864a0304a.1510995185.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <6e238a28aa79c581c90329060805c0b07e2187a7.1510995185.git.arvind.yadav.cs@gmail.com> References: <6e238a28aa79c581c90329060805c0b07e2187a7.1510995185.git.arvind.yadav.cs@gmail.com> In-Reply-To: <6e238a28aa79c581c90329060805c0b07e2187a7.1510995185.git.arvind.yadav.cs@gmail.com> References: <6e238a28aa79c581c90329060805c0b07e2187a7.1510995185.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. drivers/misc/atmel-ssc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index b2a0340..9d9eeae 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -235,9 +235,9 @@ 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; + return ssc->irq; } spin_lock(&user_lock); -- 2.7.4 From 1584458235533006914@xxx Sun Nov 19 02:05:24 +0000 2017 X-GM-THRID: 1584458235533006914 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread