Skip to content

Commit 492ed77

Browse files
Ionut NicuWolfram Sang
authored andcommitted
i2c: i2c-mux-gpio: don't ignore of_get_named_gpio errors
of_get_named_gpio could return -E_PROBE_DEFER or another error code. This error should be passed further instead of being ignored. Signed-off-by: Ionut Nicu <[email protected]> Acked-by: Peter Korsgaard <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 4cdbf7d commit 492ed77

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/i2c/muxes/i2c-mux-gpio.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
6666
struct device_node *adapter_np, *child;
6767
struct i2c_adapter *adapter;
6868
unsigned *values, *gpios;
69-
int i = 0;
69+
int i = 0, ret;
7070

7171
if (!np)
7272
return -ENODEV;
@@ -116,8 +116,12 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
116116
return -ENOMEM;
117117
}
118118

119-
for (i = 0; i < mux->data.n_gpios; i++)
120-
gpios[i] = of_get_named_gpio(np, "mux-gpios", i);
119+
for (i = 0; i < mux->data.n_gpios; i++) {
120+
ret = of_get_named_gpio(np, "mux-gpios", i);
121+
if (ret < 0)
122+
return ret;
123+
gpios[i] = ret;
124+
}
121125

122126
mux->data.gpios = gpios;
123127

0 commit comments

Comments
 (0)