Forgot to attach the patch, sorry. Here it is. -- Jean Delvare
--- drivers/i2c/algos/i2c-algo-bit.c | 8 ++++++-- include/linux/i2c-algo-bit.h | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) --- linux-3.1-rc10.orig/drivers/i2c/algos/i2c-algo-bit.c 2011-10-20 12:03:05.000000000 +0200 +++ linux-3.1-rc10/drivers/i2c/algos/i2c-algo-bit.c 2011-10-20 12:57:20.000000000 +0200 @@ -231,8 +231,11 @@ static int i2c_inb(struct i2c_adapter *i /* * Sanity check for the adapter hardware - check the reaction of * the bus lines only if it seems to be idle. + * Must be called with i2c_adap->bus_lock held if adapter is registered. + * This is done by surrounding the call to i2c_bit_test_bus() with + * i2c_lock_adapter(i2c_adap) and i2c_unlock_adapter(i2c_adap). */ -static int test_bus(struct i2c_adapter *i2c_adap) +int i2c_bit_test_bus(struct i2c_adapter *i2c_adap) { struct i2c_algo_bit_data *adap = i2c_adap->algo_data; const char *name = i2c_adap->name; @@ -320,6 +323,7 @@ bailout: return -ENODEV; } +EXPORT_SYMBOL_GPL(i2c_bit_test_bus); /* ----- Utility functions */ @@ -623,7 +627,7 @@ static int __i2c_bit_add_bus(struct i2c_ int ret; if (bit_test) { - ret = test_bus(adap); + ret = i2c_bit_test_bus(adap); if (ret < 0) return -ENODEV; } --- linux-3.1-rc10.orig/include/linux/i2c-algo-bit.h 2011-07-22 04:17:23.000000000 +0200 +++ linux-3.1-rc10/include/linux/i2c-algo-bit.h 2011-10-20 12:54:33.000000000 +0200 @@ -50,4 +50,7 @@ struct i2c_algo_bit_data { int i2c_bit_add_bus(struct i2c_adapter *); int i2c_bit_add_numbered_bus(struct i2c_adapter *); +/* Must be called with bus_lock held if adapter is registered */ +int i2c_bit_test_bus(struct i2c_adapter *); + #endif /* _LINUX_I2C_ALGO_BIT_H */
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel