diff options
author | Jiri Kosina <jikos@jikos.cz> | 2006-12-10 15:21:30 -0500 |
---|---|---|
committer | Jean Delvare <khali@arrakis.delvare> | 2006-12-10 15:21:30 -0500 |
commit | 6ea23039cb1cc7c379eb5fba0ed2c53291e9bea7 (patch) | |
tree | c22887d242a0c3813789c63c4db2fd59b1f3ef7e /drivers | |
parent | ad04d5c3879dcf79ba0fa1826eab991f7b7a2de8 (diff) |
i2c: Add support for nested i2c bus locking
This patch adds the 'level' field into the i2c_adapter structure, which is
used to represent the 'logical' level of nesting for the purposes of
lockdep. This field is then used in the i2c_transfer() function, to
acquire the per-adapter bus_lock with correct nesting level.
Signed-off-by: Jiri Kosina <jikos@jikos.cz>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/i2c-core.c | 2 |
1 files changed, 1 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 | ||