]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: (lm95234) Rely on subsystem locking
authorGuenter Roeck <linux@roeck-us.net>
Sun, 7 Sep 2025 21:09:50 +0000 (14:09 -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/lm95234.c

index 7da6c8f073322cd9860b8875f980fac71bf81d56..387b3ba81dbfc1314a3fa461dd1b75606aaead69 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/mutex.h>
 #include <linux/regmap.h>
 #include <linux/util_macros.h>
 
@@ -54,7 +53,6 @@ static const unsigned short normal_i2c[] = {
 /* Client data (each client gets its own) */
 struct lm95234_data {
        struct regmap *regmap;
-       struct mutex update_lock;
        enum chips type;
 };
 
@@ -107,19 +105,14 @@ static ssize_t lm95234_hyst_set(struct lm95234_data *data, long val)
        u32 tcrit;
        int ret;
 
-       mutex_lock(&data->update_lock);
-
        ret = regmap_read(data->regmap, LM95234_REG_TCRIT1(0), &tcrit);
        if (ret)
-               goto unlock;
+               return ret;
 
        val = DIV_ROUND_CLOSEST(clamp_val(val, -255000, 255000), 1000);
        val = clamp_val((int)tcrit - val, 0, 31);
 
-       ret = regmap_write(data->regmap, LM95234_REG_TCRIT_HYST, val);
-unlock:
-       mutex_unlock(&data->update_lock);
-       return ret;
+       return regmap_write(data->regmap, LM95234_REG_TCRIT_HYST, val);
 }
 
 static int lm95234_crit_reg(int channel)
@@ -526,7 +519,6 @@ static int lm95234_probe(struct i2c_client *client)
                return PTR_ERR(regmap);
 
        data->regmap = regmap;
-       mutex_init(&data->update_lock);
 
        /* Initialize the LM95234 chip */
        err = lm95234_init_client(dev, regmap);