aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-boardinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/i2c-boardinfo.c')
-rw-r--r--drivers/i2c/i2c-boardinfo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-boardinfo.c b/drivers/i2c/i2c-boardinfo.c
index ffb35f09df03..a26a34a06641 100644
--- a/drivers/i2c/i2c-boardinfo.c
+++ b/drivers/i2c/i2c-boardinfo.c
@@ -18,6 +18,7 @@
18 18
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21#include <linux/rwsem.h>
21 22
22#include "i2c-core.h" 23#include "i2c-core.h"
23 24
@@ -25,7 +26,7 @@
25/* These symbols are exported ONLY FOR the i2c core. 26/* These symbols are exported ONLY FOR the i2c core.
26 * No other users will be supported. 27 * No other users will be supported.
27 */ 28 */
28DEFINE_MUTEX(__i2c_board_lock); 29DECLARE_RWSEM(__i2c_board_lock);
29EXPORT_SYMBOL_GPL(__i2c_board_lock); 30EXPORT_SYMBOL_GPL(__i2c_board_lock);
30 31
31LIST_HEAD(__i2c_board_list); 32LIST_HEAD(__i2c_board_list);
@@ -63,7 +64,7 @@ i2c_register_board_info(int busnum,
63{ 64{
64 int status; 65 int status;
65 66
66 mutex_lock(&__i2c_board_lock); 67 down_write(&__i2c_board_lock);
67 68
68 /* dynamic bus numbers will be assigned after the last static one */ 69 /* dynamic bus numbers will be assigned after the last static one */
69 if (busnum >= __i2c_first_dynamic_bus_num) 70 if (busnum >= __i2c_first_dynamic_bus_num)
@@ -84,7 +85,7 @@ i2c_register_board_info(int busnum,
84 list_add_tail(&devinfo->list, &__i2c_board_list); 85 list_add_tail(&devinfo->list, &__i2c_board_list);
85 } 86 }
86 87
87 mutex_unlock(&__i2c_board_lock); 88 up_write(&__i2c_board_lock);
88 89
89 return status; 90 return status;
90} 91}