i2c: mux: demux-pinctrl: invalidate properly when switching fails
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 22 Aug 2016 14:52:21 +0000 (16:52 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 25 Aug 2016 16:41:34 +0000 (18:41 +0200)
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>
drivers/i2c/muxes/i2c-demux-pinctrl.c

index 215ac87f606d2d0f59bc17720ca2ec8fd60fae09..b6b9d2582fac561958fee93abe6deb93cb0142c4 100644 (file)
@@ -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;
 }