]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: adnp: Fix testing wrong value in adnp_gpio_direction_input
authorAxel Lin <axel.lin@ingics.com>
Mon, 11 Mar 2019 13:29:37 +0000 (21:29 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Fri, 22 Mar 2019 15:48:47 +0000 (16:48 +0100)
commit90cbdd2a0e1021db27cefacd9fe2430e42b14ef2
treecdb68a6c7101ce5df45e742da2edeb2b80923e73
parent0f84c7bc5f83de15e937670594880a81600e6b37
gpio: adnp: Fix testing wrong value in adnp_gpio_direction_input

Current code test wrong value so it does not verify if the written
data is correctly read back. Fix it.
Also make it return -EPERM if read value does not match written bit,
just like it done for adnp_gpio_direction_output().

Fixes: 6b7f9d8e9e02 ("gpio: Add Avionic Design N-bit GPIO expander support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-adnp.c