]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: (lm92) Rely on subsystem locking
authorGuenter Roeck <linux@roeck-us.net>
Sun, 7 Sep 2025 21:11:08 +0000 (14:11 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 17 Oct 2025 12:59:12 +0000 (05:59 -0700)
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>
drivers/hwmon/lm92.c

index 0be439b38ee1bb4feab1afc7a80cff5c5361c753..91a6b7525bb675bc33c47f5a2bd8ff688d4178d3 100644 (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);