From a640a80bf02dd2c10c62bbad9ccfb85829b03b5d Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sun, 7 Sep 2025 21:36:47 -0700 Subject: [PATCH] hwmon: (lm95241) 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 --- drivers/hwmon/lm95241.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c index cad0a0ff8416..456381b0938e 100644 --- a/drivers/hwmon/lm95241.c +++ b/drivers/hwmon/lm95241.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #define DEVNAME "lm95241" @@ -75,7 +74,6 @@ static const u8 lm95241_reg_address[] = { /* Client data (each client gets its own) */ struct lm95241_data { struct i2c_client *client; - struct mutex update_lock; unsigned long last_updated; /* in jiffies */ unsigned long interval; /* in milli-seconds */ bool valid; /* false until following fields are valid */ @@ -102,8 +100,6 @@ static struct lm95241_data *lm95241_update_device(struct device *dev) struct lm95241_data *data = dev_get_drvdata(dev); struct i2c_client *client = data->client; - mutex_lock(&data->update_lock); - if (time_after(jiffies, data->last_updated + msecs_to_jiffies(data->interval)) || !data->valid) { @@ -120,9 +116,6 @@ static struct lm95241_data *lm95241_update_device(struct device *dev) data->last_updated = jiffies; data->valid = true; } - - mutex_unlock(&data->update_lock); - return data; } @@ -204,8 +197,6 @@ static int lm95241_write_chip(struct device *dev, u32 attr, int channel, u8 config; int ret; - mutex_lock(&data->update_lock); - switch (attr) { case hwmon_chip_update_interval: config = data->config & ~CFG_CRMASK; @@ -231,7 +222,6 @@ static int lm95241_write_chip(struct device *dev, u32 attr, int channel, ret = -EOPNOTSUPP; break; } - mutex_unlock(&data->update_lock); return ret; } @@ -242,8 +232,6 @@ static int lm95241_write_temp(struct device *dev, u32 attr, int channel, struct i2c_client *client = data->client; int ret; - mutex_lock(&data->update_lock); - switch (attr) { case hwmon_temp_min: if (channel == 1) { @@ -313,9 +301,6 @@ static int lm95241_write_temp(struct device *dev, u32 attr, int channel, ret = -EOPNOTSUPP; break; } - - mutex_unlock(&data->update_lock); - return ret; } @@ -443,7 +428,6 @@ static int lm95241_probe(struct i2c_client *client) return -ENOMEM; data->client = client; - mutex_init(&data->update_lock); /* Initialize the LM95241 chip */ lm95241_init_client(client, data);