summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2016-08-22 16:52:21 +0200
committerWolfram Sang <wsa@the-dreams.de>2016-08-25 18:41:34 +0200
commit9a5382e8ffe86412f442f6a34fde43f94aae530b (patch)
tree54b138595fd10d1b23db33fc65afcb200a1bfdc0 /drivers/i2c
parentfa8410b355251fd30341662a40ac6b22d3e38468 (diff)
i2c: mux: demux-pinctrl: invalidate properly when switching fails
Make sure the index to the active channel is invalidated when switching fails. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/muxes/i2c-demux-pinctrl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/i2c/muxes/i2c-demux-pinctrl.c b/drivers/i2c/muxes/i2c-demux-pinctrl.c
index 215ac87f606d..b6b9d2582fac 100644
--- a/drivers/i2c/muxes/i2c-demux-pinctrl.c
+++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c
@@ -107,6 +107,7 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne
of_changeset_revert(&priv->chan[new_chan].chgset);
err:
dev_err(priv->dev, "failed to setup demux-adapter %d (%d)\n", new_chan, ret);
+ priv->cur_chan = -EINVAL;
return ret;
}