From patchwork Sun Nov 19 04:26:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10065027 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 976F66038F for ; Sun, 19 Nov 2017 04:27:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87D79292B1 for ; Sun, 19 Nov 2017 04:27:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B4B0292F3; Sun, 19 Nov 2017 04:27:24 +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 3AD3F292B1 for ; Sun, 19 Nov 2017 04:27:24 +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: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:In-Reply-To: References:List-Owner; bh=QVpqV4Jkmj5TIjl//NtmE5W7+M3WwsdDsAE5FqcRO9s=; b=VEP NqXe/li0Heael9ckrGrbFKdPLhj2rkMId/ngJmx9svz8DGO/gEpKd3Dbsqz0ohcK5rMkmzT7b57my 6rgwkoKfAS23Gn8Tw/Pw5Gb7HqprA54A/NFLgsxcpIwwv8c1EaQF7nAhtT9Nhrm4Zh4Y2NlKONpIY LKL/iTCWAD7ndSP3xUYED8KJixIuwSZBcIFtGqZ01dNALdIj6OpS2q+z7Tm1YxJGnkXtzFpA0+HhK eyOUbx3NXWC5tazj9Hw/FwTZhb5i9fr7fCHH9wO8Av1Ik9t7UWWIcEkL7/QeBeDR3RgL+LlFq1PFZ eFuBqbstL9i/Vuiga3aztHzXWj9O6nQ==; 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 1eGHCO-0004bo-VJ; Sun, 19 Nov 2017 04:27:16 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eGHCL-0004az-NQ for linux-arm-kernel@lists.infradead.org; Sun, 19 Nov 2017 04:27:15 +0000 Received: by mail-pg0-x244.google.com with SMTP id 70so4853718pgf.6 for ; Sat, 18 Nov 2017 20:26:53 -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; bh=phY0W32V2B7/MDhAuNPyopb2MAJXgBdviJbyRqaY0lI=; b=s/BdWkTkD5TZZ7rfxVO1mYhfHZOVabIlpgKCLyE6k41nsVvUKoL4fZgDJ6eOS8ZiKt MRgOxhWUFJoi3dcHgN8JQyAosGBTOwXDrLViVsNkhpeYLJuNIB8RoN7wiCc5wpU+aSQE C5wuLZYv8K6K8+05T1pTQek8+uSrow53rij5U9KbhWHgIzb0ft07aMsBtgx0jHkqnyio A8MPHjh5je//DesO2Fxf8LGARcrsWTA7Hzmcpoo7zLzkp6vQlAU0F+KHIffxZ8pT31ly TMAxScwHOMMqIJJIPGWO8Nr9sHvbOrklSVTdu9YySCwBwKodagVqIK+ZnkKL6ourIrMP brEw== 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; bh=phY0W32V2B7/MDhAuNPyopb2MAJXgBdviJbyRqaY0lI=; b=J99Jr3RTfO94LFd0zk+G4IyeNHLvrj7fAfIwP3TarB1wUF5oGeXXHlUJpzQMJuzagO mdXSKFee3JIBOa9BMBzWOTeNP6XBU863NFKZN+67MrUtGgDFQcZF68XPBijI8cJaqtdZ nUMVvn34mkU7lzZ3Ymie5nk4hljrDze23UtBT0gwvfrwN+68CGgLz6CQfkoUAISgMQq9 SPistJmtZzNbDnbroYvabZAFY61m++0lnnl/t2c8zG1LUSt26Bw9M7HmahpkTfSF/wU1 87hqWv6SLxgx071bNdweFP33FOeukn+bzEgToUTzz/NyvvX6gUDr9+25P3yYA4f46pc9 VLFQ== X-Gm-Message-State: AJaThX41N2127bEOXcvVzYqL+hFfTbk94JPwRZwJYY1qAk/sz6sLb9oL uAOlJfIr/eA1SEy71T7DI3I= X-Google-Smtp-Source: AGs4zMYgbY7YM4/El97cbwmW/RknscTsocxHKU5290JlPWTfg0urtiBTvi8e+nv+6FtYn5elDFbxew== X-Received: by 10.98.153.221 with SMTP id t90mr1004373pfk.210.1511065613183; Sat, 18 Nov 2017 20:26:53 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id e9sm11262795pgt.66.2017.11.18.20.26.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:26:52 -0800 (PST) From: Arvind Yadav To: lee.jones@linaro.org, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk Subject: [PATCH 1/3 v3] mfd: ipaq-micro: Fix platform_get_irq's error checking Date: Sun, 19 Nov 2017 09:56:32 +0530 Message-Id: <1bdd59d511e4acd23aea6af51d06b1cadf09a1b2.1511065331.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_202713_796070_530CE5D5 X-CRM114-Status: GOOD ( 10.49 ) 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'. If IRQ0 is not valid. changes in v3 : return -EINVAL insted of irq. drivers/mfd/ipaq-micro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c index cd762d0..176cf65 100644 --- a/drivers/mfd/ipaq-micro.c +++ b/drivers/mfd/ipaq-micro.c @@ -410,7 +410,7 @@ static int __init micro_probe(struct platform_device *pdev) micro_reset_comm(micro); irq = platform_get_irq(pdev, 0); - if (!irq) + if (irq <= 0) return -EINVAL; ret = devm_request_irq(&pdev->dev, irq, micro_serial_isr, IRQF_SHARED, "ipaq-micro",