gpio: mockup: don't return magic numbers from probe()
authorBartosz Golaszewski <brgl@bgdev.pl>
Fri, 9 Jun 2017 11:41:29 +0000 (13:41 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 20 Jun 2017 07:18:59 +0000 (09:18 +0200)
When the requested number of GPIO lines is 0, return -EINVAL, not
-1 which is -EPERM.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mockup.c

index 0cb6cbacc069b39c0ede1fc1b02fa039a18f057d..ab2d38e491bc1f6109bfa2585796072164a61c5d 100644 (file)
@@ -369,7 +369,7 @@ static int gpio_mockup_probe(struct platform_device *pdev)
                        ret = gpio_mockup_add(dev, &chips[i],
                                              chip_name, base, ngpio);
                } else {
-                       ret = -1;
+                       ret = -EINVAL;
                }
 
                if (ret) {