Message ID | bed6484b6919f26e7119934a33b6f9b1e94de3c9.1510999334.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 E591D60230 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 18 Nov 2017 11:04:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA90E2A007 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 18 Nov 2017 11:04:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD9642A01A; Sat, 18 Nov 2017 11:04:44 +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 283F42A683 for <patchwork-linux-arm@patchwork.kernel.org>; Sat, 18 Nov 2017 11:04:40 +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=o1a0f4oHnT718isVmqUkMbfns6SDJnrElUYUZlYH6So=; b=k3CZceXidScPfBAshAnBAcjuk/ tiXR8ulQ//qjxnzE223LrRXliaDCCSvKrIFt5vNMMDI+F8tjp8SPl213feMnFvCy0bOopPIhx70Nz daXTEmUMFhSCW5B5TXnl6XcGBhcL7gTxxTIQ8XFtn+8/fqVK4FQyHo0XDVcuXKZZW/XkyTPc2Yuw1 Nilks75r2FBuhcKIlqeqPN1xeKcxW1IJEdZn3LKQND6Hw52ndvq2C7W9kkFSjaakHTGWwTq0/GKAP MuKfHXDIKsFOyfmogogJzliANoSZxAzYdpOQUmwuhC4MNkGD5XBwpJ/nClBOH96LJCbQeJPNoY1Pw PkZQ4pIA==; 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 1eG0vI-0003oR-VR; Sat, 18 Nov 2017 11:04:32 +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 1eG0nG-0005WS-6n for linux-arm-kernel@lists.infradead.org; Sat, 18 Nov 2017 10:56:23 +0000 Received: by mail-pg0-x244.google.com with SMTP id c123so3830234pga.11 for <linux-arm-kernel@lists.infradead.org>; Sat, 18 Nov 2017 02:55:54 -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=jXcAT4LBoZ1poUz2PsU7kEMCBwo6iH1cbOKdB49TH54=; b=TqP9qoPcpKMF+k8ITr08fHBaW/RnFlOpZwgJtQVTiP/UngD0R5WReH00aM6ewl7N3p wpyl1Slk2AEMCa6A3GSRJL2YEtX0Pwq3uab800fdT/6VWnbDy8vl/RcwjYP/f0Lm248l 4WKjuhk0G4qiBeXGPSxMhzNFNIVR2nkzD6v9/aMtpeR/+HpEGdKM/f75cdyO6x1Pspv/ ZILFltzmwGUsjK53tihl+II50BfYtKVuAQICZDBMAJ0HUINhVUOF8fQJ8Y8e4mwXfA6i TJTTAY7YDt2/zPbDHTwwfWm/O45o1fDMvUbXId0dmvB3BA4FW2dGdy7KirYvLtOmZYUq 6AbA== 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=jXcAT4LBoZ1poUz2PsU7kEMCBwo6iH1cbOKdB49TH54=; b=sQhQNuWk6uaOm8wIVMnTlU2ayrMs+0J/V6ONpaKCi9k07C34RTUALL3Riau7ErHtER MzKAZTBTjbqsl5aLPxmM1PkLh8L4tFrOjjZjalMJy9lxwOvpV2RbB5qeH2tLtep4suk1 Kq6pX/MlRucpn4LM+xX1j99DPJHyj0+f1mYkBnTbY0HMR3BnwkB2qtKeOBnRDbJeG8YI JhIuU4azkKe/AYnUB9gC6oiESahmBUxYI9WZhgqenQTZTLR+CixdhdhzGTsvyuVns3sH xqKDrPS3xLefAoZGioaGsoGhAYfhVhyaf13HKQ8OMOIsMck8BugIxslQ7TfsecKsviVb VM8Q== X-Gm-Message-State: AJaThX4jth7Dl6UQnltVZRObkpNStl68RQ50S8X+bp6f/Jgwro7u3l1r TNYO1WuFIeCZuK+Dshw0oM4= X-Google-Smtp-Source: AGs4zMb3UKFCykJk8VM5ssfrkWQiVVnj3TXAJACZLZD3gJy4eHSOoge7tG++z/CA22myfvdPOdl61w== X-Received: by 10.159.230.13 with SMTP id u13mr7728512plq.293.1511002553747; Sat, 18 Nov 2017 02:55:53 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:53 -0800 (PST) From: Arvind Yadav <arvind.yadav.cs@gmail.com> To: dmitry.torokhov@gmail.com, maxime.ripard@free-electrons.com, wens@csie.org, mcuos.com@gmail.com, linux@roeck-us.net, linux@armlinux.org.uk, lee.jones@linaro.org Subject: [PATCH 08/10 v3] Input: twl4030-pwrbutton: Handle return value of platform_get_irq Date: Sat, 18 Nov 2017 16:25:15 +0530 Message-Id: <bed6484b6919f26e7119934a33b6f9b1e94de3c9.1510999334.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <a9a25cd5775ba4c76d47e8b66934e470f58d9e72.1510999558.git.arvind.yadav.cs@gmail.com> References: <a9a25cd5775ba4c76d47e8b66934e470f58d9e72.1510999558.git.arvind.yadav.cs@gmail.com> In-Reply-To: <76d6a73ba51e1a8a86d8d9a1d0bbbf7723d5153a.1510999334.git.arvind.yadav.cs@gmail.com> References: <76d6a73ba51e1a8a86d8d9a1d0bbbf7723d5153a.1510999334.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_025614_843145_CEBCA0B7 X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. 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, linux-input@vger.kernel.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/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c index b307cca..0dcf311 100644 --- a/drivers/input/misc/twl4030-pwrbutton.c +++ b/drivers/input/misc/twl4030-pwrbutton.c @@ -58,6 +58,9 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev) int irq = platform_get_irq(pdev, 0); int err; + if (irq <= 0) + return irq; + pwr = devm_input_allocate_device(&pdev->dev); if (!pwr) { dev_err(&pdev->dev, "Can't allocate power button\n");
platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> --- changes in v2 : return irq instead of -ENODEV. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/input/misc/twl4030-pwrbutton.c | 3 +++ 1 file changed, 3 insertions(+)