diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2025-09-07 14:11:08 -0700 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2025-10-17 05:59:12 -0700 |
| commit | 3f5b5795b4f797bcb6fad32cf32a431c1198f112 (patch) | |
| tree | 6b269ad423769f3e1f1818bffe856fd3dfcb585b | |
| parent | 4e94552a57099752efaea682826dbc1c31077337 (diff) | |
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>
| -rw-r--r-- | drivers/hwmon/lm92.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c index 0be439b38ee1..91a6b7525bb6 100644 --- a/drivers/hwmon/lm92.c +++ b/drivers/hwmon/lm92.c @@ -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); |
