From f18c41daea14baee11252da268cdf5dcd57c7c10 Mon Sep 17 00:00:00 2001 From: Rodolfo Giometti Date: Fri, 19 Jun 2009 16:58:20 +0200 Subject: i2c: Use rwsem instead of mutex for board info By using rwsem we can easily manage recursive calls of i2c_scan_static_board_info() function without breaking the locking. Signed-off-by: Rodolfo Giometti Signed-off-by: Jean Delvare --- drivers/i2c/i2c-core.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/i2c/i2c-core.h') diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h index cd5bff8..9f9c57f 100644 --- a/drivers/i2c/i2c-core.h +++ b/drivers/i2c/i2c-core.h @@ -16,6 +16,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + struct i2c_devinfo { struct list_head list; int busnum; @@ -25,7 +27,7 @@ struct i2c_devinfo { /* board_lock protects board_list and first_dynamic_bus_num. * only i2c core components are allowed to use these symbols. */ -extern struct mutex __i2c_board_lock; +extern struct rw_semaphore __i2c_board_lock; extern struct list_head __i2c_board_list; extern int __i2c_first_dynamic_bus_num; -- cgit v1.1