diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2025-06-07 21:07:16 -0700 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2025-10-15 11:02:43 -0700 |
| commit | 658bc40ba207ea03341c540e0632eeda7450c151 (patch) | |
| tree | 47f392ca72d07c5c431c0f92859db563e284c49f | |
| parent | 1cb5eca6f2261ab93e9cca115eec1442af066a0c (diff) | |
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>
| -rw-r--r-- | drivers/hwmon/max6697.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c index 0735a1d2c20f..6b4a52838818 100644 --- a/drivers/hwmon/max6697.c +++ b/drivers/hwmon/max6697.c @@ -13,7 +13,6 @@ #include <linux/i2c.h> #include <linux/init.h> #include <linux/module.h> -#include <linux/mutex.h> #include <linux/of.h> #include <linux/regmap.h> #include <linux/slab.h> @@ -91,8 +90,6 @@ struct max6697_data { int temp_offset; /* in degrees C */ - struct mutex update_lock; - #define MAX6697_TEMP_INPUT 0 #define MAX6697_TEMP_EXT 1 #define MAX6697_TEMP_MAX 2 @@ -302,7 +299,6 @@ static int max6697_write(struct device *dev, enum hwmon_sensor_types type, val = clamp_val(val, 0, 255); return regmap_write(regmap, MAX6697_REG_MIN, val); case hwmon_temp_offset: - mutex_lock(&data->update_lock); val = clamp_val(val, MAX6581_OFFSET_MIN, MAX6581_OFFSET_MAX); val = DIV_ROUND_CLOSEST(val, 250); if (!val) { /* disable this (and only this) channel */ @@ -313,11 +309,9 @@ static int max6697_write(struct device *dev, enum hwmon_sensor_types type, ret = regmap_set_bits(regmap, MAX6581_REG_OFFSET_SELECT, BIT(channel - 1)); if (ret) - goto unlock; + return ret; ret = regmap_write(regmap, MAX6581_REG_OFFSET, val); } -unlock: - mutex_unlock(&data->update_lock); return ret; default: return -EOPNOTSUPP; @@ -559,7 +553,6 @@ static int max6697_probe(struct i2c_client *client) data->regmap = regmap; data->type = (uintptr_t)i2c_get_match_data(client); data->chip = &max6697_chip_data[data->type]; - mutex_init(&data->update_lock); err = max6697_init_chip(client->dev.of_node, data); if (err) |
