From cb6211b6dc99e19b5c45f9714478a085d180266c Mon Sep 17 00:00:00 2001 From: Andrey Gusakov Date: Tue, 27 Aug 2019 13:08:42 +0300 Subject: [PATCH 1/6] gpio: pca953x: do not ignore i2c errors Signed-off-by: Andrey Gusakov --- drivers/gpio/gpio-pca953x.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 587bb3e..9ad0720 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -349,13 +349,8 @@ static int pca953x_gpio_get_value(struct gpio_chip *gc, unsigned off) mutex_lock(&chip->i2c_lock); ret = pca953x_read_single(chip, chip->regs->input, ®_val, off); mutex_unlock(&chip->i2c_lock); - if (ret < 0) { - /* NOTE: diagnostic already emitted; that's all we should - * do unless gpio_*_value_cansleep() calls become different - * from their nonsleeping siblings (and report faults). - */ - return 0; - } + if (ret < 0) + return ret; return (reg_val & (1u << (off % BANK_SZ))) ? 1 : 0; } -- 2.7.4