diff options
-rw-r--r-- | drivers/i2c/i2c-core.c | 2 | ||||
-rw-r--r-- | include/linux/i2c.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 7ca81f42d14b..79eaa12474dd 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -603,7 +603,7 @@ int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num) | |||
603 | } | 603 | } |
604 | #endif | 604 | #endif |
605 | 605 | ||
606 | mutex_lock(&adap->bus_lock); | 606 | mutex_lock_nested(&adap->bus_lock, adap->level); |
607 | ret = adap->algo->master_xfer(adap,msgs,num); | 607 | ret = adap->algo->master_xfer(adap,msgs,num); |
608 | mutex_unlock(&adap->bus_lock); | 608 | mutex_unlock(&adap->bus_lock); |
609 | 609 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 9b5d04768c2c..08df4169b411 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -216,6 +216,7 @@ struct i2c_adapter { | |||
216 | int (*client_unregister)(struct i2c_client *); | 216 | int (*client_unregister)(struct i2c_client *); |
217 | 217 | ||
218 | /* data fields that are valid for all devices */ | 218 | /* data fields that are valid for all devices */ |
219 | u8 level; /* nesting level for lockdep */ | ||
219 | struct mutex bus_lock; | 220 | struct mutex bus_lock; |
220 | struct mutex clist_lock; | 221 | struct mutex clist_lock; |
221 | 222 | ||