bus_lock for both the virtual adapter and its parent have the same lock
class.  Since both are taken in i2c_virt_master_xfer() and
i2c_virt_smbus_xfer(), lockdep needs an annotation that the nesting is
safe.

Signed-off-by: David Rientjes <[EMAIL PROTECTED]>
---
 drivers/i2c/i2c-virt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-virt.c b/drivers/i2c/i2c-virt.c
--- a/drivers/i2c/i2c-virt.c
+++ b/drivers/i2c/i2c-virt.c
@@ -53,7 +53,7 @@ static int i2c_virt_master_xfer(struct i2c_adapter *adap,
         * the transfer.
         */
 
-       mutex_lock(&parent->bus_lock);
+       mutex_lock_nested(&parent->bus_lock, SINGLE_DEPTH_NESTING);
 
        ret = priv->select(parent, priv->client, priv->id);
        if (ret >= 0)
@@ -79,7 +79,7 @@ static int i2c_virt_smbus_xfer(struct i2c_adapter *adap,
         * the transfer.
         */
 
-       mutex_lock(&parent->bus_lock);
+       mutex_lock_nested(&parent->bus_lock, SINGLE_DEPTH_NESTING);
 
        ret = priv->select(parent, priv->client, priv->id);
        if (ret == 0)

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

Reply via email to