summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorDan Carpenter2018-05-01 09:36:39 +0200
committerLinus Walleij2018-05-16 14:35:24 +0200
commitba3efdff2cd214e4133b73f4891f6255b610c19b (patch)
treee078b1991d239189389a3d9c64ba3fd367a0bc6b /drivers/gpio/gpiolib.c
parentgpio: xlp: Use of_device_get_match_data() (diff)
downloadkernel-qcow2-linux-ba3efdff2cd214e4133b73f4891f6255b610c19b.tar.gz
kernel-qcow2-linux-ba3efdff2cd214e4133b73f4891f6255b610c19b.tar.xz
kernel-qcow2-linux-ba3efdff2cd214e4133b73f4891f6255b610c19b.zip
gpiolib: fix gpiochip_machine_hog()
There is a shifter vs vanilla mask bug here. We want to test if 1 << 11 is set but we're testing if 0xb is set. Fixes: 9a6c505f7df1 ("gpiolib: add hogs support for machine code") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 547adc149b62..d1171db66c30 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1186,7 +1186,7 @@ static void gpiochip_machine_hog(struct gpio_chip *chip, struct gpiod_hog *hog)
return;
}
- if (desc->flags & FLAG_IS_HOGGED)
+ if (test_bit(FLAG_IS_HOGGED, &desc->flags))
return;
rv = gpiod_hog(desc, hog->line_name, hog->lflags, hog->dflags);