Received: by 10.223.164.202 with SMTP id h10csp2353005wrb; Sat, 18 Nov 2017 20:01:49 -0800 (PST) X-Google-Smtp-Source: AGs4zMY3mosp3VMR8AEZQp4FyHG32Azgn9eYjjPp7AMpDTvH0xtpj0IciK5lvBPYLAYrgzNfbAYG X-Received: by 10.101.101.151 with SMTP id u23mr1677147pgv.74.1511064109599; Sat, 18 Nov 2017 20:01:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511064109; cv=none; d=google.com; s=arc-20160816; b=ViA5smRcUI62SXBpTnCUow/0FdBamCsqBWyC06sBF1nenyEudWQCyKAENYMw5/Y0/o PtIBDGGj4llrjOGkPsZWigHfnnZVKD+YiR5T3zHoitDOoT5emmpkyzK6j5F12W2ICONb XOQ22EDjOtesN5frOX+grpgA1ztW81nEK5o/sKWdbyDrDiCpXdEfCrC91YEzaMyYudQX LhnoHs8UpMohxdN1Lue1u5WNM+QeisqT+JNVr7DFs7EKTKsep/CQxWKSEzuVtin2KNNi C0NBVsuzIOqK7O7U6thRtFuqORjXea/SAYSp6OlixKMDxh8B6+5lCpnDYk0P/ZuPYVFX GKEQ== 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=jXcAT4LBoZ1poUz2PsU7kEMCBwo6iH1cbOKdB49TH54=; b=B7ygpTUiD3C1p/HZUgt8LgfcgPoPb9ULDNlZmsgeKbpgAdyRgw3kvc4P+qReHYw/EJ vXW4rwLakMIR9q2egMRPFmyKlTbSezxn9UcZIzGgiw8vfCl+1b/bJp6y4mYk29T+dMfo YQuxSo9cmI2QJmZeRvG5mgkcHjEkWj42LJBgenThcEpvriNrYbIiLlY6rNg55Bg8GVpT Nk77b8qI4/VglBZy1KVdcBFCqQwMak/3tIOHilQp75ckezjuZkjQn9JrxTyZMDIF4JtZ 4Xch1XDUp97oOFyOTC0MjfrEnO4Pjrj3pLrXz1jUVabqDJNKNmngajkP+cWJI1HUeX2u PHEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TqP9qoPc; 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 c41si5551680plj.293.2017.11.18.20.01.36; Sat, 18 Nov 2017 20:01:49 -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=TqP9qoPc; 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 S1947126AbdKRK5M (ORCPT + 93 others); Sat, 18 Nov 2017 05:57:12 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:38184 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422816AbdKRKzy (ORCPT ); Sat, 18 Nov 2017 05:55:54 -0500 Received: by mail-pg0-f65.google.com with SMTP id s11so3843961pgc.5; 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=sZIWlE4QWuLa/n8VhnFm0NG1cL9xejr6h4p26uwwx6siu3GFgwnkXMiG4y5y8xmLos w3ASmFZNCRdQKoCLK1vyCIOlV72QARLk0ruzPxQZ47iucosGCZfneVbhFkey0jQKyXbC MYdVkncnwsV2L/JLTBurGjl4AsV5aNdprZNB+4W7M50I1l32WbuV+cOGoWGLDyITecGU Ra4iv/pscRHtUt8cbJSSxPa1+px2H6MYwTIDxxQ+sbAIkY0G/tNoYWRFbSwp5ngkX/NP lsgQsVzeERUwpW1G9aSDeT71qAcd3eJvPjAfCXOrJ1b7Z2BYBhRWH5iKXK0cu1J/L51e QX0g== X-Gm-Message-State: AJaThX6aqCw05BZdRoNE1isRf/KK7OS2wMkiHqdqrsvIaZ9WYgO/t/Oo HJDiA+00jdkHo28INvfWOzqLjgPt 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 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 Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.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: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: <76d6a73ba51e1a8a86d8d9a1d0bbbf7723d5153a.1510999334.git.arvind.yadav.cs@gmail.com> References: <76d6a73ba51e1a8a86d8d9a1d0bbbf7723d5153a.1510999334.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 platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- 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(+) 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"); -- 2.7.4 From 1584463789928836154@xxx Sun Nov 19 03:33:41 +0000 2017 X-GM-THRID: 1584369524800906590 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread