diff options
author | Yani Ioannou <yani.ioannou@gmail.com> | 2005-05-17 06:41:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:32 -0400 |
commit | 74880c063b06efd103c924abfe19d9d8fa4864c4 (patch) | |
tree | 7d0995426cec1f3577a5f8e5f61ada43a0df9813 /drivers/i2c/chips/adm1025.c | |
parent | ff381d2223a30ee70752791fd9c3588d8f1cab77 (diff) |
[PATCH] Driver Core: drivers/base - drivers/i2c/chips/adm1026.c: update device attribute callbacks
Signed-off-by: Yani Ioannou <yani.ioannou@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/chips/adm1025.c')
-rw-r--r-- | drivers/i2c/chips/adm1025.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/i2c/chips/adm1025.c b/drivers/i2c/chips/adm1025.c index e0771a3d05c9..111f0c86c933 100644 --- a/drivers/i2c/chips/adm1025.c +++ b/drivers/i2c/chips/adm1025.c | |||
@@ -153,19 +153,19 @@ struct adm1025_data { | |||
153 | */ | 153 | */ |
154 | 154 | ||
155 | #define show_in(offset) \ | 155 | #define show_in(offset) \ |
156 | static ssize_t show_in##offset(struct device *dev, char *buf) \ | 156 | static ssize_t show_in##offset(struct device *dev, struct device_attribute *attr, char *buf) \ |
157 | { \ | 157 | { \ |
158 | struct adm1025_data *data = adm1025_update_device(dev); \ | 158 | struct adm1025_data *data = adm1025_update_device(dev); \ |
159 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ | 159 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in[offset], \ |
160 | in_scale[offset])); \ | 160 | in_scale[offset])); \ |
161 | } \ | 161 | } \ |
162 | static ssize_t show_in##offset##_min(struct device *dev, char *buf) \ | 162 | static ssize_t show_in##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ |
163 | { \ | 163 | { \ |
164 | struct adm1025_data *data = adm1025_update_device(dev); \ | 164 | struct adm1025_data *data = adm1025_update_device(dev); \ |
165 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ | 165 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_min[offset], \ |
166 | in_scale[offset])); \ | 166 | in_scale[offset])); \ |
167 | } \ | 167 | } \ |
168 | static ssize_t show_in##offset##_max(struct device *dev, char *buf) \ | 168 | static ssize_t show_in##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \ |
169 | { \ | 169 | { \ |
170 | struct adm1025_data *data = adm1025_update_device(dev); \ | 170 | struct adm1025_data *data = adm1025_update_device(dev); \ |
171 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ | 171 | return sprintf(buf, "%u\n", IN_FROM_REG(data->in_max[offset], \ |
@@ -180,17 +180,17 @@ show_in(4); | |||
180 | show_in(5); | 180 | show_in(5); |
181 | 181 | ||
182 | #define show_temp(offset) \ | 182 | #define show_temp(offset) \ |
183 | static ssize_t show_temp##offset(struct device *dev, char *buf) \ | 183 | static ssize_t show_temp##offset(struct device *dev, struct device_attribute *attr, char *buf) \ |
184 | { \ | 184 | { \ |
185 | struct adm1025_data *data = adm1025_update_device(dev); \ | 185 | struct adm1025_data *data = adm1025_update_device(dev); \ |
186 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ | 186 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[offset-1])); \ |
187 | } \ | 187 | } \ |
188 | static ssize_t show_temp##offset##_min(struct device *dev, char *buf) \ | 188 | static ssize_t show_temp##offset##_min(struct device *dev, struct device_attribute *attr, char *buf) \ |
189 | { \ | 189 | { \ |
190 | struct adm1025_data *data = adm1025_update_device(dev); \ | 190 | struct adm1025_data *data = adm1025_update_device(dev); \ |
191 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ | 191 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_min[offset-1])); \ |
192 | } \ | 192 | } \ |
193 | static ssize_t show_temp##offset##_max(struct device *dev, char *buf) \ | 193 | static ssize_t show_temp##offset##_max(struct device *dev, struct device_attribute *attr, char *buf) \ |
194 | { \ | 194 | { \ |
195 | struct adm1025_data *data = adm1025_update_device(dev); \ | 195 | struct adm1025_data *data = adm1025_update_device(dev); \ |
196 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ | 196 | return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[offset-1])); \ |
@@ -200,7 +200,7 @@ show_temp(1); | |||
200 | show_temp(2); | 200 | show_temp(2); |
201 | 201 | ||
202 | #define set_in(offset) \ | 202 | #define set_in(offset) \ |
203 | static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ | 203 | static ssize_t set_in##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ |
204 | size_t count) \ | 204 | size_t count) \ |
205 | { \ | 205 | { \ |
206 | struct i2c_client *client = to_i2c_client(dev); \ | 206 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -214,7 +214,7 @@ static ssize_t set_in##offset##_min(struct device *dev, const char *buf, \ | |||
214 | up(&data->update_lock); \ | 214 | up(&data->update_lock); \ |
215 | return count; \ | 215 | return count; \ |
216 | } \ | 216 | } \ |
217 | static ssize_t set_in##offset##_max(struct device *dev, const char *buf, \ | 217 | static ssize_t set_in##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \ |
218 | size_t count) \ | 218 | size_t count) \ |
219 | { \ | 219 | { \ |
220 | struct i2c_client *client = to_i2c_client(dev); \ | 220 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -240,7 +240,7 @@ set_in(4); | |||
240 | set_in(5); | 240 | set_in(5); |
241 | 241 | ||
242 | #define set_temp(offset) \ | 242 | #define set_temp(offset) \ |
243 | static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ | 243 | static ssize_t set_temp##offset##_min(struct device *dev, struct device_attribute *attr, const char *buf, \ |
244 | size_t count) \ | 244 | size_t count) \ |
245 | { \ | 245 | { \ |
246 | struct i2c_client *client = to_i2c_client(dev); \ | 246 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -254,7 +254,7 @@ static ssize_t set_temp##offset##_min(struct device *dev, const char *buf, \ | |||
254 | up(&data->update_lock); \ | 254 | up(&data->update_lock); \ |
255 | return count; \ | 255 | return count; \ |
256 | } \ | 256 | } \ |
257 | static ssize_t set_temp##offset##_max(struct device *dev, const char *buf, \ | 257 | static ssize_t set_temp##offset##_max(struct device *dev, struct device_attribute *attr, const char *buf, \ |
258 | size_t count) \ | 258 | size_t count) \ |
259 | { \ | 259 | { \ |
260 | struct i2c_client *client = to_i2c_client(dev); \ | 260 | struct i2c_client *client = to_i2c_client(dev); \ |
@@ -275,26 +275,26 @@ static DEVICE_ATTR(temp##offset##_max, S_IWUSR | S_IRUGO, \ | |||
275 | set_temp(1); | 275 | set_temp(1); |
276 | set_temp(2); | 276 | set_temp(2); |
277 | 277 | ||
278 | static ssize_t show_alarms(struct device *dev, char *buf) | 278 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) |
279 | { | 279 | { |
280 | struct adm1025_data *data = adm1025_update_device(dev); | 280 | struct adm1025_data *data = adm1025_update_device(dev); |
281 | return sprintf(buf, "%u\n", data->alarms); | 281 | return sprintf(buf, "%u\n", data->alarms); |
282 | } | 282 | } |
283 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); | 283 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); |
284 | 284 | ||
285 | static ssize_t show_vid(struct device *dev, char *buf) | 285 | static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) |
286 | { | 286 | { |
287 | struct adm1025_data *data = adm1025_update_device(dev); | 287 | struct adm1025_data *data = adm1025_update_device(dev); |
288 | return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); | 288 | return sprintf(buf, "%u\n", vid_from_reg(data->vid, data->vrm)); |
289 | } | 289 | } |
290 | static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL); | 290 | static DEVICE_ATTR(in1_ref, S_IRUGO, show_vid, NULL); |
291 | 291 | ||
292 | static ssize_t show_vrm(struct device *dev, char *buf) | 292 | static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf) |
293 | { | 293 | { |
294 | struct adm1025_data *data = adm1025_update_device(dev); | 294 | struct adm1025_data *data = adm1025_update_device(dev); |
295 | return sprintf(buf, "%u\n", data->vrm); | 295 | return sprintf(buf, "%u\n", data->vrm); |
296 | } | 296 | } |
297 | static ssize_t set_vrm(struct device *dev, const char *buf, size_t count) | 297 | static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
298 | { | 298 | { |
299 | struct i2c_client *client = to_i2c_client(dev); | 299 | struct i2c_client *client = to_i2c_client(dev); |
300 | struct adm1025_data *data = i2c_get_clientdata(client); | 300 | struct adm1025_data *data = i2c_get_clientdata(client); |