hwmon: (tmp464) Rely on subsystem locking

Attribute access is now serialized in the hardware monitoring core,
so locking in the driver is no longer necessary. Drop it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
pull/1354/merge
Guenter Roeck 2025-06-07 20:56:22 -07:00
parent 61e9b50ffa
commit 965e7381ff
1 changed files with 1 additions and 12 deletions

View File

@ -13,7 +13,6 @@
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/slab.h>
@ -92,7 +91,6 @@ struct tmp464_channel {
struct tmp464_data {
struct regmap *regmap;
struct mutex update_lock;
int channels;
s16 config_orig;
u16 open_reg;
@ -172,19 +170,16 @@ static int tmp464_temp_read(struct device *dev, u32 attr, int channel, long *val
* complete. That means we have to cache the value internally
* for one measurement cycle and report the cached value.
*/
mutex_lock(&data->update_lock);
if (!data->valid || time_after(jiffies, data->last_updated +
msecs_to_jiffies(data->update_interval))) {
err = regmap_read(regmap, TMP464_REMOTE_OPEN_REG, &regval);
if (err < 0)
goto unlock;
break;
data->open_reg = regval;
data->last_updated = jiffies;
data->valid = true;
}
*val = !!(data->open_reg & BIT(channel + 7));
unlock:
mutex_unlock(&data->update_lock);
break;
case hwmon_temp_max_hyst:
regs[0] = TMP464_THERM_LIMIT[channel];
@ -345,8 +340,6 @@ static int tmp464_write(struct device *dev, enum hwmon_sensor_types type,
struct tmp464_data *data = dev_get_drvdata(dev);
int err;
mutex_lock(&data->update_lock);
switch (type) {
case hwmon_chip:
err = tmp464_chip_write(data, attr, channel, val);
@ -359,8 +352,6 @@ static int tmp464_write(struct device *dev, enum hwmon_sensor_types type,
break;
}
mutex_unlock(&data->update_lock);
return err;
}
@ -658,8 +649,6 @@ static int tmp464_probe(struct i2c_client *client)
if (!data)
return -ENOMEM;
mutex_init(&data->update_lock);
data->channels = (int)(unsigned long)i2c_get_match_data(client);
data->regmap = devm_regmap_init_i2c(client, &tmp464_regmap_config);