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

While at it, drop the unnecessary include of hwmon-sysfs.h.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Guenter Roeck 2025-06-07 21:08:40 -07:00
parent 658bc40ba2
commit 8ee6dc15e2
1 changed files with 0 additions and 8 deletions

View File

@ -18,7 +18,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/hwmon.h> #include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/platform_data/ltc4245.h> #include <linux/platform_data/ltc4245.h>
@ -51,7 +50,6 @@ enum ltc4245_cmd {
struct ltc4245_data { struct ltc4245_data {
struct i2c_client *client; struct i2c_client *client;
struct mutex update_lock;
bool valid; bool valid;
unsigned long last_updated; /* in jiffies */ unsigned long last_updated; /* in jiffies */
@ -132,10 +130,7 @@ static struct ltc4245_data *ltc4245_update_device(struct device *dev)
s32 val; s32 val;
int i; int i;
mutex_lock(&data->update_lock);
if (time_after(jiffies, data->last_updated + HZ) || !data->valid) { if (time_after(jiffies, data->last_updated + HZ) || !data->valid) {
/* Read control registers -- 0x00 to 0x07 */ /* Read control registers -- 0x00 to 0x07 */
for (i = 0; i < ARRAY_SIZE(data->cregs); i++) { for (i = 0; i < ARRAY_SIZE(data->cregs); i++) {
val = i2c_smbus_read_byte_data(client, i); val = i2c_smbus_read_byte_data(client, i);
@ -161,8 +156,6 @@ static struct ltc4245_data *ltc4245_update_device(struct device *dev)
data->valid = true; data->valid = true;
} }
mutex_unlock(&data->update_lock);
return data; return data;
} }
@ -454,7 +447,6 @@ static int ltc4245_probe(struct i2c_client *client)
return -ENOMEM; return -ENOMEM;
data->client = client; data->client = client;
mutex_init(&data->update_lock);
data->use_extra_gpios = ltc4245_use_extra_gpios(client); data->use_extra_gpios = ltc4245_use_extra_gpios(client);
/* Initialize the LTC4245 chip */ /* Initialize the LTC4245 chip */