diff options
author | Rodolfo Giometti <giometti@linux.it> | 2009-06-19 10:58:20 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-06-19 10:58:20 -0400 |
commit | f18c41daea14baee11252da268cdf5dcd57c7c10 (patch) | |
tree | ec42ed7000fa64925db3cd596737bd54d9fa71ca /drivers/i2c/i2c-core.h | |
parent | 99cd8e25875a109455b709b5a41d4891b8d8e58e (diff) |
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 <giometti@linux.it>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c/i2c-core.h')
-rw-r--r-- | drivers/i2c/i2c-core.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h index cd5bff874855..9f9c57ff6708 100644 --- a/drivers/i2c/i2c-core.h +++ b/drivers/i2c/i2c-core.h | |||
@@ -16,6 +16,8 @@ | |||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/rwsem.h> | ||
20 | |||
19 | struct i2c_devinfo { | 21 | struct i2c_devinfo { |
20 | struct list_head list; | 22 | struct list_head list; |
21 | int busnum; | 23 | int busnum; |
@@ -25,7 +27,7 @@ struct i2c_devinfo { | |||
25 | /* board_lock protects board_list and first_dynamic_bus_num. | 27 | /* board_lock protects board_list and first_dynamic_bus_num. |
26 | * only i2c core components are allowed to use these symbols. | 28 | * only i2c core components are allowed to use these symbols. |
27 | */ | 29 | */ |
28 | extern struct mutex __i2c_board_lock; | 30 | extern struct rw_semaphore __i2c_board_lock; |
29 | extern struct list_head __i2c_board_list; | 31 | extern struct list_head __i2c_board_list; |
30 | extern int __i2c_first_dynamic_bus_num; | 32 | extern int __i2c_first_dynamic_bus_num; |
31 | 33 | ||