mirror of https://github.com/torvalds/linux.git
hwmon: (lm95241) Rely on subsystem locking
Attribute access is now serialized in the hardware monitoring core, so locking in the driver code is no longer necessary. Drop it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
3da03e4e0e
commit
a640a80bf0
|
|
@ -15,7 +15,6 @@
|
|||
#include <linux/jiffies.h>
|
||||
#include <linux/hwmon.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#define DEVNAME "lm95241"
|
||||
|
|
@ -75,7 +74,6 @@ static const u8 lm95241_reg_address[] = {
|
|||
/* Client data (each client gets its own) */
|
||||
struct lm95241_data {
|
||||
struct i2c_client *client;
|
||||
struct mutex update_lock;
|
||||
unsigned long last_updated; /* in jiffies */
|
||||
unsigned long interval; /* in milli-seconds */
|
||||
bool valid; /* false until following fields are valid */
|
||||
|
|
@ -102,8 +100,6 @@ static struct lm95241_data *lm95241_update_device(struct device *dev)
|
|||
struct lm95241_data *data = dev_get_drvdata(dev);
|
||||
struct i2c_client *client = data->client;
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
if (time_after(jiffies, data->last_updated
|
||||
+ msecs_to_jiffies(data->interval)) ||
|
||||
!data->valid) {
|
||||
|
|
@ -120,9 +116,6 @@ static struct lm95241_data *lm95241_update_device(struct device *dev)
|
|||
data->last_updated = jiffies;
|
||||
data->valid = true;
|
||||
}
|
||||
|
||||
mutex_unlock(&data->update_lock);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
@ -204,8 +197,6 @@ static int lm95241_write_chip(struct device *dev, u32 attr, int channel,
|
|||
u8 config;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
switch (attr) {
|
||||
case hwmon_chip_update_interval:
|
||||
config = data->config & ~CFG_CRMASK;
|
||||
|
|
@ -231,7 +222,6 @@ static int lm95241_write_chip(struct device *dev, u32 attr, int channel,
|
|||
ret = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&data->update_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -242,8 +232,6 @@ static int lm95241_write_temp(struct device *dev, u32 attr, int channel,
|
|||
struct i2c_client *client = data->client;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
switch (attr) {
|
||||
case hwmon_temp_min:
|
||||
if (channel == 1) {
|
||||
|
|
@ -313,9 +301,6 @@ static int lm95241_write_temp(struct device *dev, u32 attr, int channel,
|
|||
ret = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
|
||||
mutex_unlock(&data->update_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -443,7 +428,6 @@ static int lm95241_probe(struct i2c_client *client)
|
|||
return -ENOMEM;
|
||||
|
||||
data->client = client;
|
||||
mutex_init(&data->update_lock);
|
||||
|
||||
/* Initialize the LM95241 chip */
|
||||
lm95241_init_client(client, data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue