From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbcEMQGD (ORCPT ); Fri, 13 May 2016 12:06:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39579 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753371AbcEMQGA (ORCPT ); Fri, 13 May 2016 12:06:00 -0400 From: Benjamin Tissoires To: Dmitry Torokhov , linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Bastien Nocera , Lejun Zhu , Fabio Estevam Subject: [PATCH v2 1/6] Input - soc_button_array: use gpio_is_valid() Date: Fri, 13 May 2016 18:05:49 +0200 Message-Id: <1463155554-11747-2-git-send-email-benjamin.tissoires@redhat.com> In-Reply-To: <1463155554-11747-1-git-send-email-benjamin.tissoires@redhat.com> References: <1463155554-11747-1-git-send-email-benjamin.tissoires@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 13 May 2016 16:05:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gpio_keys will later use gpio_is_valid(). To match the actual behavior, we should use it here too. Signed-off-by: Benjamin Tissoires --- changes in v2: - fixed gpio_is_valid(gpio) -> !gpio_is_valid(gpio) drivers/input/misc/soc_button_array.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index c14b827..bbd433c 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c @@ -17,6 +17,7 @@ #include #include #include +#include #include /* @@ -92,7 +93,7 @@ soc_button_device_create(struct platform_device *pdev, continue; gpio = soc_button_lookup_gpio(&pdev->dev, info->acpi_index); - if (gpio < 0) + if (!gpio_is_valid(gpio)) continue; gpio_keys[n_buttons].type = info->event_type; -- 2.5.0