aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/lm80.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/chips/lm80.c')
-rw-r--r--drivers/i2c/chips/lm80.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/i2c/chips/lm80.c b/drivers/i2c/chips/lm80.c
index a72f431971bb..404057b70e90 100644
--- a/drivers/i2c/chips/lm80.c
+++ b/drivers/i2c/chips/lm80.c
@@ -156,7 +156,7 @@ static struct i2c_driver lm80_driver = {
156 */ 156 */
157 157
158#define show_in(suffix, value) \ 158#define show_in(suffix, value) \
159static ssize_t show_in_##suffix(struct device *dev, char *buf) \ 159static ssize_t show_in_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
160{ \ 160{ \
161 struct lm80_data *data = lm80_update_device(dev); \ 161 struct lm80_data *data = lm80_update_device(dev); \
162 return sprintf(buf, "%d\n", IN_FROM_REG(data->value)); \ 162 return sprintf(buf, "%d\n", IN_FROM_REG(data->value)); \
@@ -184,7 +184,7 @@ show_in(input5, in[5]);
184show_in(input6, in[6]); 184show_in(input6, in[6]);
185 185
186#define set_in(suffix, value, reg) \ 186#define set_in(suffix, value, reg) \
187static ssize_t set_in_##suffix(struct device *dev, const char *buf, \ 187static ssize_t set_in_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
188 size_t count) \ 188 size_t count) \
189{ \ 189{ \
190 struct i2c_client *client = to_i2c_client(dev); \ 190 struct i2c_client *client = to_i2c_client(dev); \
@@ -213,7 +213,7 @@ set_in(max5, in_max[5], LM80_REG_IN_MAX(5));
213set_in(max6, in_max[6], LM80_REG_IN_MAX(6)); 213set_in(max6, in_max[6], LM80_REG_IN_MAX(6));
214 214
215#define show_fan(suffix, value, div) \ 215#define show_fan(suffix, value, div) \
216static ssize_t show_fan_##suffix(struct device *dev, char *buf) \ 216static ssize_t show_fan_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
217{ \ 217{ \
218 struct lm80_data *data = lm80_update_device(dev); \ 218 struct lm80_data *data = lm80_update_device(dev); \
219 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value, \ 219 return sprintf(buf, "%d\n", FAN_FROM_REG(data->value, \
@@ -225,7 +225,7 @@ show_fan(input1, fan[0], fan_div[0]);
225show_fan(input2, fan[1], fan_div[1]); 225show_fan(input2, fan[1], fan_div[1]);
226 226
227#define show_fan_div(suffix, value) \ 227#define show_fan_div(suffix, value) \
228static ssize_t show_fan_div##suffix(struct device *dev, char *buf) \ 228static ssize_t show_fan_div##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
229{ \ 229{ \
230 struct lm80_data *data = lm80_update_device(dev); \ 230 struct lm80_data *data = lm80_update_device(dev); \
231 return sprintf(buf, "%d\n", DIV_FROM_REG(data->value)); \ 231 return sprintf(buf, "%d\n", DIV_FROM_REG(data->value)); \
@@ -234,7 +234,7 @@ show_fan_div(1, fan_div[0]);
234show_fan_div(2, fan_div[1]); 234show_fan_div(2, fan_div[1]);
235 235
236#define set_fan(suffix, value, reg, div) \ 236#define set_fan(suffix, value, reg, div) \
237static ssize_t set_fan_##suffix(struct device *dev, const char *buf, \ 237static ssize_t set_fan_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
238 size_t count) \ 238 size_t count) \
239{ \ 239{ \
240 struct i2c_client *client = to_i2c_client(dev); \ 240 struct i2c_client *client = to_i2c_client(dev); \
@@ -292,7 +292,7 @@ static ssize_t set_fan_div(struct device *dev, const char *buf,
292} 292}
293 293
294#define set_fan_div(number) \ 294#define set_fan_div(number) \
295static ssize_t set_fan_div##number(struct device *dev, const char *buf, \ 295static ssize_t set_fan_div##number(struct device *dev, struct device_attribute *attr, const char *buf, \
296 size_t count) \ 296 size_t count) \
297{ \ 297{ \
298 return set_fan_div(dev, buf, count, number - 1); \ 298 return set_fan_div(dev, buf, count, number - 1); \
@@ -300,14 +300,14 @@ static ssize_t set_fan_div##number(struct device *dev, const char *buf, \
300set_fan_div(1); 300set_fan_div(1);
301set_fan_div(2); 301set_fan_div(2);
302 302
303static ssize_t show_temp_input1(struct device *dev, char *buf) 303static ssize_t show_temp_input1(struct device *dev, struct device_attribute *attr, char *buf)
304{ 304{
305 struct lm80_data *data = lm80_update_device(dev); 305 struct lm80_data *data = lm80_update_device(dev);
306 return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp)); 306 return sprintf(buf, "%ld\n", TEMP_FROM_REG(data->temp));
307} 307}
308 308
309#define show_temp(suffix, value) \ 309#define show_temp(suffix, value) \
310static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ 310static ssize_t show_temp_##suffix(struct device *dev, struct device_attribute *attr, char *buf) \
311{ \ 311{ \
312 struct lm80_data *data = lm80_update_device(dev); \ 312 struct lm80_data *data = lm80_update_device(dev); \
313 return sprintf(buf, "%d\n", TEMP_LIMIT_FROM_REG(data->value)); \ 313 return sprintf(buf, "%d\n", TEMP_LIMIT_FROM_REG(data->value)); \
@@ -318,7 +318,7 @@ show_temp(os_max, temp_os_max);
318show_temp(os_hyst, temp_os_hyst); 318show_temp(os_hyst, temp_os_hyst);
319 319
320#define set_temp(suffix, value, reg) \ 320#define set_temp(suffix, value, reg) \
321static ssize_t set_temp_##suffix(struct device *dev, const char *buf, \ 321static ssize_t set_temp_##suffix(struct device *dev, struct device_attribute *attr, const char *buf, \
322 size_t count) \ 322 size_t count) \
323{ \ 323{ \
324 struct i2c_client *client = to_i2c_client(dev); \ 324 struct i2c_client *client = to_i2c_client(dev); \
@@ -336,7 +336,7 @@ set_temp(hot_hyst, temp_hot_hyst, LM80_REG_TEMP_HOT_HYST);
336set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX); 336set_temp(os_max, temp_os_max, LM80_REG_TEMP_OS_MAX);
337set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST); 337set_temp(os_hyst, temp_os_hyst, LM80_REG_TEMP_OS_HYST);
338 338
339static ssize_t show_alarms(struct device *dev, char *buf) 339static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
340{ 340{
341 struct lm80_data *data = lm80_update_device(dev); 341 struct lm80_data *data = lm80_update_device(dev);
342 return sprintf(buf, "%u\n", data->alarms); 342 return sprintf(buf, "%u\n", data->alarms);