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

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

+1 -8
+1 -8
drivers/hwmon/max6697.c
··· 13 13 #include <linux/i2c.h> 14 14 #include <linux/init.h> 15 15 #include <linux/module.h> 16 - #include <linux/mutex.h> 17 16 #include <linux/of.h> 18 17 #include <linux/regmap.h> 19 18 #include <linux/slab.h> ··· 89 90 const struct max6697_chip_data *chip; 90 91 91 92 int temp_offset; /* in degrees C */ 92 - 93 - struct mutex update_lock; 94 93 95 94 #define MAX6697_TEMP_INPUT 0 96 95 #define MAX6697_TEMP_EXT 1 ··· 299 302 val = clamp_val(val, 0, 255); 300 303 return regmap_write(regmap, MAX6697_REG_MIN, val); 301 304 case hwmon_temp_offset: 302 - mutex_lock(&data->update_lock); 303 305 val = clamp_val(val, MAX6581_OFFSET_MIN, MAX6581_OFFSET_MAX); 304 306 val = DIV_ROUND_CLOSEST(val, 250); 305 307 if (!val) { /* disable this (and only this) channel */ ··· 309 313 ret = regmap_set_bits(regmap, MAX6581_REG_OFFSET_SELECT, 310 314 BIT(channel - 1)); 311 315 if (ret) 312 - goto unlock; 316 + return ret; 313 317 ret = regmap_write(regmap, MAX6581_REG_OFFSET, val); 314 318 } 315 - unlock: 316 - mutex_unlock(&data->update_lock); 317 319 return ret; 318 320 default: 319 321 return -EOPNOTSUPP; ··· 553 559 data->regmap = regmap; 554 560 data->type = (uintptr_t)i2c_get_match_data(client); 555 561 data->chip = &max6697_chip_data[data->type]; 556 - mutex_init(&data->update_lock); 557 562 558 563 err = max6697_init_chip(client->dev.of_node, data); 559 564 if (err)