diff options
Diffstat (limited to 'drivers/hwmon/w83792d.c')
-rw-r--r-- | drivers/hwmon/w83792d.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c index 2e86e188b27a..6865c64d8a51 100644 --- a/drivers/hwmon/w83792d.c +++ b/drivers/hwmon/w83792d.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/hwmon.h> | 43 | #include <linux/hwmon.h> |
44 | #include <linux/hwmon-sysfs.h> | 44 | #include <linux/hwmon-sysfs.h> |
45 | #include <linux/err.h> | 45 | #include <linux/err.h> |
46 | #include <linux/mutex.h> | ||
46 | 47 | ||
47 | /* Addresses to scan */ | 48 | /* Addresses to scan */ |
48 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; | 49 | static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, I2C_CLIENT_END }; |
@@ -271,7 +272,7 @@ struct w83792d_data { | |||
271 | struct class_device *class_dev; | 272 | struct class_device *class_dev; |
272 | enum chips type; | 273 | enum chips type; |
273 | 274 | ||
274 | struct semaphore update_lock; | 275 | struct mutex update_lock; |
275 | char valid; /* !=0 if following fields are valid */ | 276 | char valid; /* !=0 if following fields are valid */ |
276 | unsigned long last_updated; /* In jiffies */ | 277 | unsigned long last_updated; /* In jiffies */ |
277 | 278 | ||
@@ -1222,7 +1223,7 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1222 | data->type = kind; | 1223 | data->type = kind; |
1223 | 1224 | ||
1224 | data->valid = 0; | 1225 | data->valid = 0; |
1225 | init_MUTEX(&data->update_lock); | 1226 | mutex_init(&data->update_lock); |
1226 | 1227 | ||
1227 | /* Tell the I2C layer a new client has arrived */ | 1228 | /* Tell the I2C layer a new client has arrived */ |
1228 | if ((err = i2c_attach_client(client))) | 1229 | if ((err = i2c_attach_client(client))) |
@@ -1373,7 +1374,7 @@ static struct w83792d_data *w83792d_update_device(struct device *dev) | |||
1373 | int i, j; | 1374 | int i, j; |
1374 | u8 reg_array_tmp[4], pwm_array_tmp[7], reg_tmp; | 1375 | u8 reg_array_tmp[4], pwm_array_tmp[7], reg_tmp; |
1375 | 1376 | ||
1376 | down(&data->update_lock); | 1377 | mutex_lock(&data->update_lock); |
1377 | 1378 | ||
1378 | if (time_after | 1379 | if (time_after |
1379 | (jiffies - data->last_updated, (unsigned long) (HZ * 3)) | 1380 | (jiffies - data->last_updated, (unsigned long) (HZ * 3)) |
@@ -1484,7 +1485,7 @@ static struct w83792d_data *w83792d_update_device(struct device *dev) | |||
1484 | data->valid = 1; | 1485 | data->valid = 1; |
1485 | } | 1486 | } |
1486 | 1487 | ||
1487 | up(&data->update_lock); | 1488 | mutex_unlock(&data->update_lock); |
1488 | 1489 | ||
1489 | #ifdef DEBUG | 1490 | #ifdef DEBUG |
1490 | w83792d_print_debug(data, dev); | 1491 | w83792d_print_debug(data, dev); |