Message ID | 4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.git.arvind.yadav.cs@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> 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 2B66D60230 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 18 Nov 2017 08:51:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26E3C29C05 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 18 Nov 2017 08:51:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BC302A1C9; Sat, 18 Nov 2017 08:51:33 +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 C790B29C05 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 18 Nov 2017 08:51:32 +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=2r5ahpt1MZ1vl9jNba+VZxTozUIOM6TfHoTrE8wd5uY=; b=Q6a lxPh8NwYCZwQ3VBlaR1azCHjI56qBiOfG+41Xo3F2wkl5gBO75/kKD6SYgyvFycw7RdrDvC2b+2cR Z68TFFXf0ck5/s8JF+Iv63RmW9YbDiRomyKffPjj0LL7k2BlVwbznYVGArBIhYq66Q0WiyJixuNXD ZeyZUMdwMXoAxck4LkhDKLDD3VbviW4ZxiEZ96CUQ/HeFlb6/ra9IfzO9Mws/6BCGHNkvji10F4+o 6nCzTojt31UYABuBUcsslrPrQOmDTB5U/lqMbgzSMRGHnaaOCGBsjWDRQSrwodJxEvaVrib2GZikp RVXFD6bxgCwV5NVPBkgrO0xIThGeSmQ==; 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 1eFyqS-0002Lq-8b; Sat, 18 Nov 2017 08:51:24 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFyqP-00028U-81 for linux-arm-kernel@lists.infradead.org; Sat, 18 Nov 2017 08:51:22 +0000 Received: by mail-pg0-x241.google.com with SMTP id p9so3699073pgc.8 for <linux-arm-kernel@lists.infradead.org>; Sat, 18 Nov 2017 00:51:01 -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=I19kyb0zmAd9DDIbmNs6PJmjm0vGy6gw6c3/oCRVsAE=; b=pVqOEVFqVJTAbAwt82fO1sv3xOdxq4dN5s3a4/Z+jCt08PGZyxKV63uff12cBVOKBX A6FUcohfHjS4r8V5e1OU/dewJVxQWVZlYCn78/HDZMMxmPKA+J+w1yD5DRRvaB2sMIrc LfdqMMROkqAtKdl38etB4tOi70c5pZJDrBZR+sZYgDO23Kt+1NmirnQcTMyIaeIA87iH NTlVGgOdntoUxgQbROYVJe4/i5/82QouOFnc96oxM3qK56Fe0aq8NnmimB1VV81GzXLs tivyKb3Fe1Z/XMkEEcHHhy9zAQNOhoGHS5SkAPeHes09zdJFfoUcRGnUaHbXn2YVm4X4 kOjQ== 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=I19kyb0zmAd9DDIbmNs6PJmjm0vGy6gw6c3/oCRVsAE=; b=sclHBu7gLjIsmYkNyQ5VWM8J16co8U+zWNSwlIc75ad67OSVw134zRM8h3iga0GnmE 9RPTXLxe67jbn2mkwdCC9hgksifzG/IZsOP8yhqCcp+1gh+vB7wKHL7ksEMhD7yQcNKd qePFDq7DxUxXkCH1zdUnRp3wfH8XLU2YRcBU659IkoqJMKCNFr7AFD58ch3fPXCItB2x l6IGpTrS3p9xZNHQsoGido5YAhwG3D80xpAaX9DzwutHLBmAU7Q6FlsnM+tBw0xQBR9N qwYeiqw6TR/niqqEfYO9NAN4Oue+vjhCWRE3ANfRG6/m9pnWrHOJIbCdBE+VKvN/pU+W scxQ== X-Gm-Message-State: AJaThX5B3IN/IfwGfFJb2NjVqFFVdVrJJoyin8Sm2iOdGVXyvla6XGD2 S809+an0U/fXaAJ5TfQ9pTVPxD7i X-Google-Smtp-Source: AGs4zMZHBF416qHjNszCbqD+Gyvz3LvzJ6I0L9wmamSlHLcyrQv7LOtKyjZVFtGUUGqnBbsccZf1lA== X-Received: by 10.84.172.195 with SMTP id n61mr7690468plb.321.1510995060726; Sat, 18 Nov 2017 00:51:00 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id 3sm11847104pfo.17.2017.11.18.00.50.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 00:51:00 -0800 (PST) From: Arvind Yadav <arvind.yadav.cs@gmail.com> To: lee.jones@linaro.org, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk Subject: [PATCH 1/3 v2] mfd: ipaq-micro: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 14:20:47 +0530 Message-Id: <4f12b680d2f0d7554e6a1812f15037185a5a9a2a.1510994294.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_005121_343519_EF2AB257 X-CRM114-Status: GOOD ( 10.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c index cd762d0..ea729db 100644 --- a/drivers/mfd/ipaq-micro.c +++ b/drivers/mfd/ipaq-micro.c @@ -410,8 +410,8 @@ static int __init micro_probe(struct platform_device *pdev) micro_reset_comm(micro); irq = platform_get_irq(pdev, 0); - if (!irq) - return -EINVAL; + if (irq <= 0) + return irq; ret = devm_request_irq(&pdev->dev, irq, micro_serial_isr, IRQF_SHARED, "ipaq-micro", micro);
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 <arvind.yadav.cs@gmail.com> --- changes in v2 : Add failure case '<= 0' instead of '< 0'. If IRQ0 is not valid. drivers/mfd/ipaq-micro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)