struct i2c_algorithm algo;
 
        struct i2c_adapter *parent;
-       void *mux_priv; /* the mux chip/device */
-       u32  chan_id;   /* the channel id */
+       struct device *mux_dev;
+       void *mux_priv;
+       u32 chan_id;
 
        int (*select)(struct i2c_adapter *, void *mux_priv, u32 chan_id);
        int (*deselect)(struct i2c_adapter *, void *mux_priv, u32 chan_id);
 
        /* Set up private adapter data */
        priv->parent = parent;
+       priv->mux_dev = mux_dev;
        priv->mux_priv = mux_priv;
        priv->chan_id = chan_id;
        priv->select = select;
        char symlink_name[20];
 
        snprintf(symlink_name, sizeof(symlink_name), "channel-%u", priv->chan_id);
-       sysfs_remove_link(&adap->dev.parent->kobj, symlink_name);
+       sysfs_remove_link(&priv->mux_dev->kobj, symlink_name);
 
        sysfs_remove_link(&priv->adap.dev.kobj, "mux_device");
        i2c_del_adapter(adap);