Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (lm95234) 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>

+2 -10
+2 -10
drivers/hwmon/lm95234.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/module.h> 16 16 #include <linux/slab.h> 17 - #include <linux/mutex.h> 18 17 #include <linux/regmap.h> 19 18 #include <linux/util_macros.h> 20 19 ··· 53 54 /* Client data (each client gets its own) */ 54 55 struct lm95234_data { 55 56 struct regmap *regmap; 56 - struct mutex update_lock; 57 57 enum chips type; 58 58 }; 59 59 ··· 105 107 u32 tcrit; 106 108 int ret; 107 109 108 - mutex_lock(&data->update_lock); 109 - 110 110 ret = regmap_read(data->regmap, LM95234_REG_TCRIT1(0), &tcrit); 111 111 if (ret) 112 - goto unlock; 112 + return ret; 113 113 114 114 val = DIV_ROUND_CLOSEST(clamp_val(val, -255000, 255000), 1000); 115 115 val = clamp_val((int)tcrit - val, 0, 31); 116 116 117 - ret = regmap_write(data->regmap, LM95234_REG_TCRIT_HYST, val); 118 - unlock: 119 - mutex_unlock(&data->update_lock); 120 - return ret; 117 + return regmap_write(data->regmap, LM95234_REG_TCRIT_HYST, val); 121 118 } 122 119 123 120 static int lm95234_crit_reg(int channel) ··· 519 526 return PTR_ERR(regmap); 520 527 521 528 data->regmap = regmap; 522 - mutex_init(&data->update_lock); 523 529 524 530 /* Initialize the LM95234 chip */ 525 531 err = lm95234_init_client(dev, regmap);