aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2016-09-16 12:02:42 -0400
committerWolfram Sang <wsa@the-dreams.de>2016-09-24 04:48:18 -0400
commit8dd1fe1594a712eb326e1607c694fbd1baf85f4b (patch)
tree2058f58e44b3ecd72aac347e308fbcffbbd77625 /drivers/i2c/i2c-core.c
parent72cf8c565cf4e25312fb9fa65d306ae736104ade (diff)
i2c: export i2c_adapter_depth()
For crazy setups in which an i2c gpio expander is behind an i2c gpio multiplexer controlled by a gpio provided a second expander using the same device driver we need to explicitly tell lockdep how to handle nested locking. Export i2c_adapter_depth() as public API to be reused outside of i2c core code. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Acked-by: Peter Rosin <peda@axentia.se> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r--drivers/i2c/i2c-core.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index cdbbd9bdb7b4..981de21ab814 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1426,13 +1426,7 @@ static void i2c_adapter_dev_release(struct device *dev)
1426 complete(&adap->dev_released); 1426 complete(&adap->dev_released);
1427} 1427}
1428 1428
1429/* 1429unsigned int i2c_adapter_depth(struct i2c_adapter *adapter)
1430 * This function is only needed for mutex_lock_nested, so it is never
1431 * called unless locking correctness checking is enabled. Thus we
1432 * make it inline to avoid a compiler warning. That's what gcc ends up
1433 * doing anyway.
1434 */
1435static inline unsigned int i2c_adapter_depth(struct i2c_adapter *adapter)
1436{ 1430{
1437 unsigned int depth = 0; 1431 unsigned int depth = 0;
1438 1432
@@ -1441,6 +1435,7 @@ static inline unsigned int i2c_adapter_depth(struct i2c_adapter *adapter)
1441 1435
1442 return depth; 1436 return depth;
1443} 1437}
1438EXPORT_SYMBOL_GPL(i2c_adapter_depth);
1444 1439
1445/* 1440/*
1446 * Let users instantiate I2C devices through sysfs. This can be used when 1441 * Let users instantiate I2C devices through sysfs. This can be used when