hwmon: (lm92) 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:
Guenter Roeck 2025-09-07 14:11:08 -07:00
parent 4e94552a57
commit 3f5b5795b4
1 changed files with 2 additions and 9 deletions

View File

@ -32,7 +32,6 @@
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/regmap.h>
#include <linux/slab.h>
@ -78,7 +77,6 @@ static inline u8 ALARMS_FROM_REG(s16 reg)
/* Client data (each client gets its own) */
struct lm92_data {
struct regmap *regmap;
struct mutex update_lock;
int resolution;
};
@ -199,15 +197,11 @@ static int lm92_temp_write(struct lm92_data *data, u32 attr, long val)
break;
case hwmon_temp_crit_hyst:
val = clamp_val(val, -120000, 220000);
mutex_lock(&data->update_lock);
err = regmap_read(regmap, LM92_REG_TEMP_CRIT, &temp);
if (err)
goto unlock;
return err;
val = TEMP_TO_REG(TEMP_FROM_REG(temp) - val, data->resolution);
err = regmap_write(regmap, LM92_REG_TEMP_HYST, val);
unlock:
mutex_unlock(&data->update_lock);
return err;
return regmap_write(regmap, LM92_REG_TEMP_HYST, val);
default:
return -EOPNOTSUPP;
}
@ -396,7 +390,6 @@ static int lm92_probe(struct i2c_client *client)
data->regmap = regmap;
data->resolution = (unsigned long)i2c_get_match_data(client);
mutex_init(&data->update_lock);
/* Initialize the chipset */
err = lm92_init_client(regmap);