summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/ams/ams-i2c.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2008-10-17 17:51:12 +0200
committerJean Delvare <khali@mahadeva.delvare>2008-10-17 17:51:12 +0200
commitee4cd32ee8a68e22081f698602e4315fb4272853 (patch)
treee44f309816eeb26727a23180ecede53f372705cd /drivers/hwmon/ams/ams-i2c.c
parent0a02002268bf624a8b0eaf3b4eb5c4207bd80d8b (diff)
hwmon: (ams) Fix locking issues
Use a separate mutex to serialize input device creation/removal, otheriwse we deadlock if we try to remove input device while it is being polled. Also do not take ams_info.lock when it is not needed. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/ams/ams-i2c.c')
-rw-r--r--drivers/hwmon/ams/ams-i2c.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c
index da26de01068..2cbf8a6506c 100644
--- a/drivers/hwmon/ams/ams-i2c.c
+++ b/drivers/hwmon/ams/ams-i2c.c
@@ -261,8 +261,6 @@ int __init ams_i2c_init(struct device_node *np)
{
int result;
- mutex_lock(&ams_info.lock);
-
/* Set implementation stuff */
ams_info.of_node = np;
ams_info.exit = ams_i2c_exit;
@@ -273,7 +271,5 @@ int __init ams_i2c_init(struct device_node *np)
result = i2c_add_driver(&ams_i2c_driver);
- mutex_unlock(&ams_info.lock);
-
return result;
}