diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c index bf511c0efa4894cc14afd0e91b6dbf9577c7c0fa..f64380a7d004d7cad16d4a0bb1e9e056a3797761 100644 --- a/drivers/gpio/gpio-pcf857x.c +++ b/drivers/gpio/gpio-pcf857x.c @@ -154,7 +154,7 @@ static int pcf857x_get(struct gpio_chip *chip, unsigned offset) int value; value = gpio->read(gpio->client); - return (value < 0) ? 0 : (value & (1 << offset)); + return (value < 0) ? value : !!(value & (1 << offset)); } static int pcf857x_output(struct gpio_chip *chip, unsigned offset, int value)