summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/i2c-mux.c')
-rw-r--r--drivers/i2c/i2c-mux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 593f7ca9adc7..06cc1ff088f1 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -32,8 +32,9 @@ struct i2c_mux_priv {
32 struct i2c_algorithm algo; 32 struct i2c_algorithm algo;
33 33
34 struct i2c_adapter *parent; 34 struct i2c_adapter *parent;
35 void *mux_priv; /* the mux chip/device */ 35 struct device *mux_dev;
36 u32 chan_id; /* the channel id */ 36 void *mux_priv;
37 u32 chan_id;
37 38
38 int (*select)(struct i2c_adapter *, void *mux_priv, u32 chan_id); 39 int (*select)(struct i2c_adapter *, void *mux_priv, u32 chan_id);
39 int (*deselect)(struct i2c_adapter *, void *mux_priv, u32 chan_id); 40 int (*deselect)(struct i2c_adapter *, void *mux_priv, u32 chan_id);
@@ -119,6 +120,7 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
119 120
120 /* Set up private adapter data */ 121 /* Set up private adapter data */
121 priv->parent = parent; 122 priv->parent = parent;
123 priv->mux_dev = mux_dev;
122 priv->mux_priv = mux_priv; 124 priv->mux_priv = mux_priv;
123 priv->chan_id = chan_id; 125 priv->chan_id = chan_id;
124 priv->select = select; 126 priv->select = select;
@@ -203,7 +205,7 @@ void i2c_del_mux_adapter(struct i2c_adapter *adap)
203 char symlink_name[20]; 205 char symlink_name[20];
204 206
205 snprintf(symlink_name, sizeof(symlink_name), "channel-%u", priv->chan_id); 207 snprintf(symlink_name, sizeof(symlink_name), "channel-%u", priv->chan_id);
206 sysfs_remove_link(&adap->dev.parent->kobj, symlink_name); 208 sysfs_remove_link(&priv->mux_dev->kobj, symlink_name);
207 209
208 sysfs_remove_link(&priv->adap.dev.kobj, "mux_device"); 210 sysfs_remove_link(&priv->adap.dev.kobj, "mux_device");
209 i2c_del_adapter(adap); 211 i2c_del_adapter(adap);