blob: ca7a24933608ccce8ac19513d4939712186e4a4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
From cb6211b6dc99e19b5c45f9714478a085d180266c Mon Sep 17 00:00:00 2001
From: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
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 <andrey.gusakov@cogentembedded.com>
---
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
|