diff options
Diffstat (limited to 'drivers/i2c/chips/lm63.c')
-rw-r--r-- | drivers/i2c/chips/lm63.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/i2c/chips/lm63.c b/drivers/i2c/chips/lm63.c index 14cc5af03739..bc68e031392b 100644 --- a/drivers/i2c/chips/lm63.c +++ b/drivers/i2c/chips/lm63.c | |||
@@ -177,7 +177,7 @@ struct lm63_data { | |||
177 | */ | 177 | */ |
178 | 178 | ||
179 | #define show_fan(value) \ | 179 | #define show_fan(value) \ |
180 | static ssize_t show_##value(struct device *dev, char *buf) \ | 180 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
181 | { \ | 181 | { \ |
182 | struct lm63_data *data = lm63_update_device(dev); \ | 182 | struct lm63_data *data = lm63_update_device(dev); \ |
183 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->value)); \ | 183 | return sprintf(buf, "%d\n", FAN_FROM_REG(data->value)); \ |
@@ -185,7 +185,7 @@ static ssize_t show_##value(struct device *dev, char *buf) \ | |||
185 | show_fan(fan1_input); | 185 | show_fan(fan1_input); |
186 | show_fan(fan1_low); | 186 | show_fan(fan1_low); |
187 | 187 | ||
188 | static ssize_t set_fan1_low(struct device *dev, const char *buf, | 188 | static ssize_t set_fan1_low(struct device *dev, struct device_attribute *attr, const char *buf, |
189 | size_t count) | 189 | size_t count) |
190 | { | 190 | { |
191 | struct i2c_client *client = to_i2c_client(dev); | 191 | struct i2c_client *client = to_i2c_client(dev); |
@@ -202,7 +202,7 @@ static ssize_t set_fan1_low(struct device *dev, const char *buf, | |||
202 | return count; | 202 | return count; |
203 | } | 203 | } |
204 | 204 | ||
205 | static ssize_t show_pwm1(struct device *dev, char *buf) | 205 | static ssize_t show_pwm1(struct device *dev, struct device_attribute *attr, char *buf) |
206 | { | 206 | { |
207 | struct lm63_data *data = lm63_update_device(dev); | 207 | struct lm63_data *data = lm63_update_device(dev); |
208 | return sprintf(buf, "%d\n", data->pwm1_value >= 2 * data->pwm1_freq ? | 208 | return sprintf(buf, "%d\n", data->pwm1_value >= 2 * data->pwm1_freq ? |
@@ -210,7 +210,7 @@ static ssize_t show_pwm1(struct device *dev, char *buf) | |||
210 | (2 * data->pwm1_freq)); | 210 | (2 * data->pwm1_freq)); |
211 | } | 211 | } |
212 | 212 | ||
213 | static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) | 213 | static ssize_t set_pwm1(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
214 | { | 214 | { |
215 | struct i2c_client *client = to_i2c_client(dev); | 215 | struct i2c_client *client = to_i2c_client(dev); |
216 | struct lm63_data *data = i2c_get_clientdata(client); | 216 | struct lm63_data *data = i2c_get_clientdata(client); |
@@ -229,20 +229,20 @@ static ssize_t set_pwm1(struct device *dev, const char *buf, size_t count) | |||
229 | return count; | 229 | return count; |
230 | } | 230 | } |
231 | 231 | ||
232 | static ssize_t show_pwm1_enable(struct device *dev, char *buf) | 232 | static ssize_t show_pwm1_enable(struct device *dev, struct device_attribute *attr, char *buf) |
233 | { | 233 | { |
234 | struct lm63_data *data = lm63_update_device(dev); | 234 | struct lm63_data *data = lm63_update_device(dev); |
235 | return sprintf(buf, "%d\n", data->config_fan & 0x20 ? 1 : 2); | 235 | return sprintf(buf, "%d\n", data->config_fan & 0x20 ? 1 : 2); |
236 | } | 236 | } |
237 | 237 | ||
238 | #define show_temp8(value) \ | 238 | #define show_temp8(value) \ |
239 | static ssize_t show_##value(struct device *dev, char *buf) \ | 239 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
240 | { \ | 240 | { \ |
241 | struct lm63_data *data = lm63_update_device(dev); \ | 241 | struct lm63_data *data = lm63_update_device(dev); \ |
242 | return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->value)); \ | 242 | return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->value)); \ |
243 | } | 243 | } |
244 | #define show_temp11(value) \ | 244 | #define show_temp11(value) \ |
245 | static ssize_t show_##value(struct device *dev, char *buf) \ | 245 | static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ |
246 | { \ | 246 | { \ |
247 | struct lm63_data *data = lm63_update_device(dev); \ | 247 | struct lm63_data *data = lm63_update_device(dev); \ |
248 | return sprintf(buf, "%d\n", TEMP11_FROM_REG(data->value)); \ | 248 | return sprintf(buf, "%d\n", TEMP11_FROM_REG(data->value)); \ |
@@ -255,7 +255,7 @@ show_temp11(temp2_low); | |||
255 | show_temp8(temp2_crit); | 255 | show_temp8(temp2_crit); |
256 | 256 | ||
257 | #define set_temp8(value, reg) \ | 257 | #define set_temp8(value, reg) \ |
258 | static ssize_t set_##value(struct device *dev, const char *buf, \ | 258 | static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \ |
259 | size_t count) \ | 259 | size_t count) \ |
260 | { \ | 260 | { \ |
261 | struct i2c_client *client = to_i2c_client(dev); \ | 261 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -269,7 +269,7 @@ static ssize_t set_##value(struct device *dev, const char *buf, \ | |||
269 | return count; \ | 269 | return count; \ |
270 | } | 270 | } |
271 | #define set_temp11(value, reg_msb, reg_lsb) \ | 271 | #define set_temp11(value, reg_msb, reg_lsb) \ |
272 | static ssize_t set_##value(struct device *dev, const char *buf, \ | 272 | static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, \ |
273 | size_t count) \ | 273 | size_t count) \ |
274 | { \ | 274 | { \ |
275 | struct i2c_client *client = to_i2c_client(dev); \ | 275 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -289,7 +289,7 @@ set_temp11(temp2_low, LM63_REG_REMOTE_LOW_MSB, LM63_REG_REMOTE_LOW_LSB); | |||
289 | 289 | ||
290 | /* Hysteresis register holds a relative value, while we want to present | 290 | /* Hysteresis register holds a relative value, while we want to present |
291 | an absolute to user-space */ | 291 | an absolute to user-space */ |
292 | static ssize_t show_temp2_crit_hyst(struct device *dev, char *buf) | 292 | static ssize_t show_temp2_crit_hyst(struct device *dev, struct device_attribute *attr, char *buf) |
293 | { | 293 | { |
294 | struct lm63_data *data = lm63_update_device(dev); | 294 | struct lm63_data *data = lm63_update_device(dev); |
295 | return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp2_crit) | 295 | return sprintf(buf, "%d\n", TEMP8_FROM_REG(data->temp2_crit) |
@@ -298,7 +298,7 @@ static ssize_t show_temp2_crit_hyst(struct device *dev, char *buf) | |||
298 | 298 | ||
299 | /* And now the other way around, user-space provides an absolute | 299 | /* And now the other way around, user-space provides an absolute |
300 | hysteresis value and we have to store a relative one */ | 300 | hysteresis value and we have to store a relative one */ |
301 | static ssize_t set_temp2_crit_hyst(struct device *dev, const char *buf, | 301 | static ssize_t set_temp2_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf, |
302 | size_t count) | 302 | size_t count) |
303 | { | 303 | { |
304 | struct i2c_client *client = to_i2c_client(dev); | 304 | struct i2c_client *client = to_i2c_client(dev); |
@@ -314,7 +314,7 @@ static ssize_t set_temp2_crit_hyst(struct device *dev, const char *buf, | |||
314 | return count; | 314 | return count; |
315 | } | 315 | } |
316 | 316 | ||
317 | static ssize_t show_alarms(struct device *dev, char *buf) | 317 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) |
318 | { | 318 | { |
319 | struct lm63_data *data = lm63_update_device(dev); | 319 | struct lm63_data *data = lm63_update_device(dev); |
320 | return sprintf(buf, "%u\n", data->alarms); | 320 | return sprintf(buf, "%u\n", data->alarms); |