1
0
Fork 0

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>
hifive-unleashed-5.1
Dan Carpenter 2018-05-01 10:36:39 +03:00 committed by Linus Walleij
parent 0c695e38d9
commit ba3efdff2c
1 changed files with 1 additions and 1 deletions

View File

@ -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);