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

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>

-8
-8
drivers/hwmon/ltc4245.c
··· 18 18 #include <linux/slab.h> 19 19 #include <linux/i2c.h> 20 20 #include <linux/hwmon.h> 21 - #include <linux/hwmon-sysfs.h> 22 21 #include <linux/jiffies.h> 23 22 #include <linux/platform_data/ltc4245.h> 24 23 ··· 50 51 struct ltc4245_data { 51 52 struct i2c_client *client; 52 53 53 - struct mutex update_lock; 54 54 bool valid; 55 55 unsigned long last_updated; /* in jiffies */ 56 56 ··· 130 132 s32 val; 131 133 int i; 132 134 133 - mutex_lock(&data->update_lock); 134 - 135 135 if (time_after(jiffies, data->last_updated + HZ) || !data->valid) { 136 - 137 136 /* Read control registers -- 0x00 to 0x07 */ 138 137 for (i = 0; i < ARRAY_SIZE(data->cregs); i++) { 139 138 val = i2c_smbus_read_byte_data(client, i); ··· 155 160 data->last_updated = jiffies; 156 161 data->valid = true; 157 162 } 158 - 159 - mutex_unlock(&data->update_lock); 160 163 161 164 return data; 162 165 } ··· 447 454 return -ENOMEM; 448 455 449 456 data->client = client; 450 - mutex_init(&data->update_lock); 451 457 data->use_extra_gpios = ltc4245_use_extra_gpios(client); 452 458 453 459 /* Initialize the LTC4245 chip */