diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-02-20 11:15:48 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-03-16 16:52:12 -0400 |
commit | 562e7a4032d1ff33e283d7ba1d5f10fe7ea96669 (patch) | |
tree | c501dfe72d90e884c9d6eb5128c5d4f3e6113c6c | |
parent | 4033d4a4f5236b01200010bf38928347af75d86e (diff) |
platform/x86: surface3_button: Propagate error from gpiod_count()
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/platform/x86/surface3_button.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/platform/x86/surface3_button.c b/drivers/platform/x86/surface3_button.c index 8bfd7f613d36..57f51476bb65 100644 --- a/drivers/platform/x86/surface3_button.c +++ b/drivers/platform/x86/surface3_button.c | |||
@@ -196,9 +196,10 @@ static int surface3_button_probe(struct i2c_client *client, | |||
196 | strlen(SURFACE_BUTTON_OBJ_NAME))) | 196 | strlen(SURFACE_BUTTON_OBJ_NAME))) |
197 | return -ENODEV; | 197 | return -ENODEV; |
198 | 198 | ||
199 | if (gpiod_count(dev, KBUILD_MODNAME) <= 0) { | 199 | error = gpiod_count(dev, NULL); |
200 | if (error < 0) { | ||
200 | dev_dbg(dev, "no GPIO attached, ignoring...\n"); | 201 | dev_dbg(dev, "no GPIO attached, ignoring...\n"); |
201 | return -ENODEV; | 202 | return error; |
202 | } | 203 | } |
203 | 204 | ||
204 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); | 205 | priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); |