Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dan Carpenter and committed by
Linus Walleij
ba3efdff 0c695e38

+1 -1
+1 -1
drivers/gpio/gpiolib.c
··· 1186 1186 return; 1187 1187 } 1188 1188 1189 - if (desc->flags & FLAG_IS_HOGGED) 1189 + if (test_bit(FLAG_IS_HOGGED, &desc->flags)) 1190 1190 return; 1191 1191 1192 1192 rv = gpiod_hog(desc, hog->line_name, hog->lflags, hog->dflags);