All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: gpio: gpio-mockup-chardev GPIOHANDLE_REQUEST_OUTPUT fix
@ 2018-06-06 17:44 ` rafael.tinoco
  0 siblings, 0 replies; 15+ messages in thread
From: Rafael David Tinoco @ 2018-06-06 17:44 UTC (permalink / raw)
  To: bamv2005
  Cc: brgl, shuah, linux-gpio, linux-kselftest, linux-kernel, rafael.tinoco

Following logic from commit: 22f6592b23, GPIOHANDLE_REQUEST_OUTPUT
should handle errors same way as GPIOHANDLE_REQUEST_INPUT does, or else
the following error occurs:

gpio-mockup-chardev: gpio<gpiochip1> line<0> test flag<0x2> value<0>: No
such file or directory

despite the real result of gpio_pin_test(), gpio_debugfs_get() and
gpiotools_request_linehandle() functions.

Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
---
 tools/testing/selftests/gpio/gpio-mockup-chardev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/gpio/gpio-mockup-chardev.c b/tools/testing/selftests/gpio/gpio-mockup-chardev.c
index 667e916fa7cc..f8d468f54e98 100644
--- a/tools/testing/selftests/gpio/gpio-mockup-chardev.c
+++ b/tools/testing/selftests/gpio/gpio-mockup-chardev.c
@@ -225,10 +225,10 @@ int gpio_pin_test(struct gpiochip_info *cinfo, int line, int flag, int value)
 		if (flag & GPIOHANDLE_REQUEST_ACTIVE_LOW)
 			debugfs_value = !debugfs_value;
 
-		if (!(debugfs_dir == OUT && value == debugfs_value))
+		if (!(debugfs_dir == OUT && value == debugfs_value)) {
 			errno = -EINVAL;
-		ret = -errno;
-
+			ret = -errno;
+		}
 	}
 	gpiotools_release_linehandle(fd);
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-07-09 15:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-06 17:44 [PATCH] selftests: gpio: gpio-mockup-chardev GPIOHANDLE_REQUEST_OUTPUT fix Rafael David Tinoco
2018-06-06 17:44 ` Rafael David Tinoco
2018-06-06 17:44 ` rafael.tinoco
2018-06-14 14:42 ` Linus Walleij
2018-06-14 14:42   ` Linus Walleij
2018-06-14 14:42   ` linus.walleij
2018-06-28  1:15   ` Rafael Tinoco
2018-06-28  1:15     ` Rafael Tinoco
2018-06-28  1:15     ` rafael.tinoco
2018-07-09 14:08 ` Linus Walleij
2018-07-09 14:08   ` Linus Walleij
2018-07-09 14:08   ` linus.walleij
2018-07-09 15:05   ` Bartosz Golaszewski
2018-07-09 15:05     ` Bartosz Golaszewski
2018-07-09 15:05     ` brgl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.