]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
i2c: mux: populate the new *_atomic callbacks
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 3 Apr 2019 12:40:11 +0000 (14:40 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 16 Apr 2019 11:08:12 +0000 (13:08 +0200)
If the parent adapter has atomic_xfer callbacks, populate them for the
mux adapter as well. We can use the same translation function as for the
non-atomic xfer callback.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Peter Rosin <peda@axentia.se>
Reviewed-by Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/i2c-mux.c

index f330690b41253ff75e352b321575cc008fcf0353..603252fa12843bf8f7aee3fb64ad476de6caa8a0 100644 (file)
@@ -310,12 +310,18 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
                else
                        priv->algo.master_xfer = __i2c_mux_master_xfer;
        }
+       if (parent->algo->master_xfer_atomic)
+               priv->algo.master_xfer_atomic = priv->algo.master_xfer;
+
        if (parent->algo->smbus_xfer) {
                if (muxc->mux_locked)
                        priv->algo.smbus_xfer = i2c_mux_smbus_xfer;
                else
                        priv->algo.smbus_xfer = __i2c_mux_smbus_xfer;
        }
+       if (parent->algo->smbus_xfer_atomic)
+               priv->algo.smbus_xfer_atomic = priv->algo.smbus_xfer;
+
        priv->algo.functionality = i2c_mux_functionality;
 
        /* Now fill out new adapter structure */