Merge branch 'i2c/for-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
[muen/linux.git] / drivers / i2c / i2c-mux.c
index 221365eb7c05e12af92056f00f9af89dfb0eec72..f330690b41253ff75e352b321575cc008fcf0353 100644 (file)
@@ -144,7 +144,7 @@ static void i2c_mux_lock_bus(struct i2c_adapter *adapter, unsigned int flags)
        struct i2c_mux_priv *priv = adapter->algo_data;
        struct i2c_adapter *parent = priv->muxc->parent;
 
-       rt_mutex_lock(&parent->mux_lock);
+       rt_mutex_lock_nested(&parent->mux_lock, i2c_adapter_depth(adapter));
        if (!(flags & I2C_LOCK_ROOT_ADAPTER))
                return;
        i2c_lock_bus(parent, flags);
@@ -181,7 +181,7 @@ static void i2c_parent_lock_bus(struct i2c_adapter *adapter,
        struct i2c_mux_priv *priv = adapter->algo_data;
        struct i2c_adapter *parent = priv->muxc->parent;
 
-       rt_mutex_lock(&parent->mux_lock);
+       rt_mutex_lock_nested(&parent->mux_lock, i2c_adapter_depth(adapter));
        i2c_lock_bus(parent, flags);
 }