summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-sysfs.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-10-21 14:25:36 +0300
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2020-10-26 17:43:15 +0300
commit8bbff39c6c6c86405fe023ccf50eeb44feacbde9 (patch)
treee0a0d6126a7cc0ec0b3d21fcbf8be09cf4bd5aff /drivers/gpio/gpiolib-sysfs.c
parent40941954f6ce1d8b92a37fc35a28f83632deda8b (diff)
downloadlinux-8bbff39c6c6c86405fe023ccf50eeb44feacbde9.tar.xz
gpiolib: Unify expectations about ->request() returned value
Half of the code in the GPIO library is written in an expectation that any non-zero value returned from the ->request() callback is an error code, while some code checks only for negative values. Unify expectations about ->request() returned value to be non-zero for an error and 0 for the success. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio/gpiolib-sysfs.c')
-rw-r--r--drivers/gpio/gpiolib-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 728f6c687182..26c5466b8179 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -476,7 +476,7 @@ static ssize_t export_store(struct class *class,
*/
status = gpiod_request(desc, "sysfs");
- if (status < 0) {
+ if (status) {
if (status == -EPROBE_DEFER)
status = -ENODEV;
goto done;