Input: soc_button_array - Propagate error from gpiod_count()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 20 Feb 2017 16:15:49 +0000 (18:15 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 16 Mar 2017 20:52:12 +0000 (21:52 +0100)
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>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/input/misc/soc_button_array.c

index ddb2f22fca7aff42ff7c3ae13b7b3f3e18eefafa..c3b8e1fb46996b9b4df86fe27144bc817b2e692e 100644 (file)
@@ -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);