aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/patches-4.14/0195-pinctrl-mediatek-mt7622-align-error-handling-of-mtk_.patch
blob: 49842dddb7fb19499d80b75c046679a3e9e374d4 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 8d3e3f3159284dba7a86788464edd4d5cdba4f06 Mon Sep 17 00:00:00 2001
From: Sean Wang <sean.wang@mediatek.com>
Date: Wed, 10 Jan 2018 00:28:25 +0800
Subject: [PATCH 195/224] pinctrl: mediatek: mt7622: align error handling of
 mtk_hw_get_value call

Make consistent error handling of all mtk_hw_get_value occurrences using
propagating error code from the internal instead of creating a new one.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/mediatek/pinctrl-mt7622.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/pinctrl/mediatek/pinctrl-mt7622.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt7622.c
@@ -1160,7 +1160,7 @@ static int mtk_pinconf_get(struct pinctr
 	case PIN_CONFIG_OUTPUT_ENABLE:
 		err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_DIR, &val);
 		if (err)
-			return -EINVAL;
+			return err;
 
 		/* HW takes input mode as zero; output mode as non-zero */
 		if ((val && param == PIN_CONFIG_INPUT_ENABLE) ||
@@ -1184,11 +1184,11 @@ static int mtk_pinconf_get(struct pinctr
 	case PIN_CONFIG_DRIVE_STRENGTH:
 		err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_E4, &val);
 		if (err)
-			return -EINVAL;
+			return err;
 
 		err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_E8, &val2);
 		if (err)
-			return -EINVAL;
+			return err;
 
 		/* 4mA when (e8, e4) = (0, 0); 8mA when (e8, e4) = (0, 1)
 		 * 12mA when (e8, e4) = (1, 0); 16mA when (e8, e4) = (1, 1)
@@ -1203,7 +1203,7 @@ static int mtk_pinconf_get(struct pinctr
 
 		err = mtk_hw_get_value(hw, pin, reg, &val);
 		if (err)
-			return -EINVAL;
+			return err;
 
 		ret = val;