summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-adnp.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-30 11:33:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-30 11:33:34 -0700
commit3af9a5256f448e3d0405f7905c430ef2f9f32b9c (patch)
tree947da1e128e28c3b0b7134a8d08f3a6bb8534fc0 /drivers/gpio/gpio-adnp.c
parent32faca66bd3f6aa7ec4212d20c7b2d45657fab10 (diff)
parent86d0756558b701b2c5502d90f705c2936008922d (diff)
downloadlinux-3af9a5256f448e3d0405f7905c430ef2f9f32b9c.tar.bz2
Merge tag 'gpio-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij: "As you can see [in the git history] I was away on leave and Bartosz kindly stepped in and collected a slew of fixes, I pulled them into my tree in two sets and merged some two more fixes (fixing my own caused bugs) on top. Summary: - Revert the extended use of gpio_set_config() and think about how we can do this properly. - Fix up the SPI CS GPIO handling so it now works properly on the SPI bus children, as intended. - Error paths and driver fixes" * tag 'gpio-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: mockup: use simple_read_from_buffer() in debugfs read callback gpio: of: Fix of_gpiochip_add() error path gpio: of: Check for "spi-cs-high" in child instead of parent node gpio: of: Check propname before applying "cs-gpios" quirks gpio: mockup: fix debugfs read Revert "gpio: use new gpio_set_config() helper in more places" gpio: aspeed: fix a potential NULL pointer dereference gpio: amd-fch: Fix bogus SPDX identifier gpio: adnp: Fix testing wrong value in adnp_gpio_direction_input gpio: exar: add a check for the return value of ida_simple_get fails
Diffstat (limited to 'drivers/gpio/gpio-adnp.c')
-rw-r--r--drivers/gpio/gpio-adnp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
index 91b90c0cea73..12acdac85820 100644
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -132,8 +132,10 @@ static int adnp_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
if (err < 0)
goto out;
- if (err & BIT(pos))
- err = -EACCES;
+ if (value & BIT(pos)) {
+ err = -EPERM;
+ goto out;
+ }
err = 0;