Received: by 10.223.164.202 with SMTP id h10csp2352670wrb; Sat, 18 Nov 2017 20:01:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMYxALKlZAVzw1K5eZzmbRjElCOcMG6rtYxUGe6HkTxyasnt9mvP7ViTnmRrFxNPwAvMcLCv X-Received: by 10.84.218.10 with SMTP id q10mr10351097pli.111.1511064076677; Sat, 18 Nov 2017 20:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511064076; cv=none; d=google.com; s=arc-20160816; b=DYP/UZ/MupBOdwsN/aHAxtGicvD+VdH6dP4AnVMKD4Xus5/9uxkzh4ezY8mz2qE29J ifd2MzDGk6OSAw8GEL36e9q7oMmikRoehPe1BCl84tf1tmCkUGQwW07+i7fDqx8AoRoJ tmn0pSr+0F4pngbFFUbcrQ9bTfTnBsRwrpVS9Ep9OuZYRZGQJ8usBud7Bvhh+1HRVHgL 6XOyX6VT5G7e+8jyDqOzgy2m/ff9bg7FcKr3F++95yxhwVikViF5cErDpTRymT+lYxqA J2FQSjV+DDYteaJoM3GvJ8OnsEyJSUinAcim5HcfwdeeO2gHSQOT6G/OF0DJ4lSiZ5fw LZpA== 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=J7RTNyBZghdVyWyOjffezbG4CAd0Qamg9+g/ktIiZrg=; b=D1OtqKdHVHkX1Y6eY9iSXilwyhgaHMq5jIBN2kSGrjPbCyfkiQaAJt+dSx3QI4U4km U1j6useLT9J+BblOKMw2HsxaxeY2qGT9h+VCD5wYrcxhc0r3C7H5nb6WywUvT6CxAT6o 0mVvq1lBTHe+XAXPcoiac8TAQ0ZsRud14vKjv4/NBKQOhFFnP9EhLZiM22dDEsOwsfGP FLKh/dHFQ/jUj8PUmwiSSISBpTe83hZoBzhSFF7D4M7Y2TvD1YHA24jka07x04Rzx6Si CrNrMkJrPpd+/3P26Ywaz2fKy/6ehHZUYbMGtiRbPgdeOu4Ju0bWC2PfX90rbf+IMcqo D/gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ITcUMjpX; 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 m30si958133pli.522.2017.11.18.20.01.03; Sat, 18 Nov 2017 20:01:16 -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=ITcUMjpX; 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 S1946585AbdKRKzu (ORCPT + 93 others); Sat, 18 Nov 2017 05:55:50 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:40973 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422816AbdKRKzd (ORCPT ); Sat, 18 Nov 2017 05:55:33 -0500 Received: by mail-pf0-f194.google.com with SMTP id j28so3815618pfk.8; Sat, 18 Nov 2017 02:55:33 -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=J7RTNyBZghdVyWyOjffezbG4CAd0Qamg9+g/ktIiZrg=; b=ITcUMjpXJmno1eN+IDxVgwD/Zq2WNTY44w9V2GS6U8fwbNnXsDQt/hFRODR8ovNHB1 Q/xN7CENO4BDi8xZGhhWIBRxmnpqz/5fHLcqAN8OCmuvPYu3n2H8wFMGJEEKUvWJNlvC FTR5K1A4AwhaVJNd6JF2kXaw7TbuowSAYuBh4HaZsOlxcFcU8zXqS6woxaUyRqkz57LQ ikYI7kikQ4eRKc3SrZLzRBnO3TByDzmsTa1RW0jt/IqLSKtipkaQNCmbWw1OYgbkctYV m7elqo9u6vrzsD7jobzTLovSOAz+Y/siCaiQPTSvqkGu3E2hekntV+TTTvXZjdgy5w+j pzKg== 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=J7RTNyBZghdVyWyOjffezbG4CAd0Qamg9+g/ktIiZrg=; b=d81PEBCPAOu3kQP4WRa1uORNAixzdI037T78Fs0RnWvEOB+Wc2AUnO0+RuzWM2kJty u/V7AepVhI5c1PS+eQsNDkAIIH53V8grgS9pizkqL+vI25kSG10VtJ8Z2XiLUEo42QQd 7MqlNPoJjzJTpLfqCsLcv21/E17ywTU/zM+OwVRfR5P6246+jNCy38npzP871qUBEYnK T8G85H89CisQOnk3Le0kAy3kYPiszajKLwIigq1i39ESsPfNM/LHe/pukb9C3T5jN5gO tl+eB0o5Hi4wYOpjcKodtVI3T6zgC3Ub7tG+6KOfBiSffSVkoqp6BWRxrgzEIBjhX7pF sW4Q== X-Gm-Message-State: AJaThX6CCdNZ0c/AMPb20WoTiiy5FBDFNjvF9aD09yYGS1tvEo/LWGdq wPqTfyMR1213GaTKMuJIU6Q= X-Received: by 10.99.55.30 with SMTP id e30mr7777226pga.156.1511002532777; Sat, 18 Nov 2017 02:55:32 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:32 -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 02/10 v3] Input: omap4-keypad: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 16:25:09 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: 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: Return irq insted of -EINVAL. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/input/keyboard/omap4-keypad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 940d38b..9ad840c 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -251,9 +251,9 @@ static int omap4_keypad_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (!irq) { + if (irq <= 0) { dev_err(&pdev->dev, "no keyboard irq assigned\n"); - return -EINVAL; + return irq; } keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL); -- 2.7.4 From 1584465824458831155@xxx Sun Nov 19 04:06:02 +0000 2017 X-GM-THRID: 1584465824458831155 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread