lkml.org 
[lkml]   [2017]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 4/4] Input: soc_button_array - Propagate error from gpiod_count()
Date
Since gpiod_count() does not return 0 anymore, we don't need to shadow
its error code and would safely propagate to the user.

While here, replace second parameter by NULL in order to prevent side
effects on _DSD enabled firmware.

Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/input/misc/soc_button_array.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
index ddb2f22fca7a..c3b8e1fb4699 100644
--- a/drivers/input/misc/soc_button_array.c
+++ b/drivers/input/misc/soc_button_array.c
@@ -169,9 +169,10 @@ static int soc_button_probe(struct platform_device *pdev)

button_info = (struct soc_button_info *)id->driver_data;

- if (gpiod_count(dev, KBUILD_MODNAME) <= 0) {
+ error = gpiod_count(dev, NULL);
+ if (error < 0) {
dev_dbg(dev, "no GPIO attached, ignoring...\n");
- return -ENODEV;
+ return error;
}

priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
--
2.11.0
\
 
 \ /
  Last update: 2017-02-20 17:16    [W:0.117 / U:1.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site