Add a patch accepted in 2.6.24-rc1 that was forgotten
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.24-rc1 / 0003-hwmon-Convert-from-class_device-to-device.patch
blob9126ba3184c07ca4a5308d5c714d3fdce8647f4c
1 From 1beeffe43311f64df8dd0ab08ff6b1858c58363f Mon Sep 17 00:00:00 2001
2 From: Tony Jones <tonyj@suse.de>
3 Date: Mon, 20 Aug 2007 13:46:20 -0700
4 Subject: [PATCH] hwmon: Convert from class_device to device
6 Convert from class_device to device for hwmon_device_register/unregister
8 Signed-off-by: Tony Jones <tonyj@suse.de>
9 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
10 Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
11 Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
12 ---
13 drivers/hwmon/abituguru.c | 10 +++++-----
14 drivers/hwmon/abituguru3.c | 10 +++++-----
15 drivers/hwmon/ad7418.c | 10 +++++-----
16 drivers/hwmon/adm1021.c | 10 +++++-----
17 drivers/hwmon/adm1025.c | 10 +++++-----
18 drivers/hwmon/adm1026.c | 10 +++++-----
19 drivers/hwmon/adm1029.c | 10 +++++-----
20 drivers/hwmon/adm1031.c | 10 +++++-----
21 drivers/hwmon/adm9240.c | 10 +++++-----
22 drivers/hwmon/adt7470.c | 10 +++++-----
23 drivers/hwmon/applesmc.c | 10 +++++-----
24 drivers/hwmon/asb100.c | 10 +++++-----
25 drivers/hwmon/atxp1.c | 10 +++++-----
26 drivers/hwmon/coretemp.c | 10 +++++-----
27 drivers/hwmon/dme1737.c | 10 +++++-----
28 drivers/hwmon/ds1621.c | 10 +++++-----
29 drivers/hwmon/f71805f.c | 10 +++++-----
30 drivers/hwmon/f71882fg.c | 10 +++++-----
31 drivers/hwmon/f75375s.c | 10 +++++-----
32 drivers/hwmon/fscher.c | 10 +++++-----
33 drivers/hwmon/fscpos.c | 10 +++++-----
34 drivers/hwmon/gl518sm.c | 10 +++++-----
35 drivers/hwmon/gl520sm.c | 10 +++++-----
36 drivers/hwmon/hwmon.c | 27 +++++++++++++--------------
37 drivers/hwmon/it87.c | 10 +++++-----
38 drivers/hwmon/k8temp.c | 10 +++++-----
39 drivers/hwmon/lm63.c | 10 +++++-----
40 drivers/hwmon/lm70.c | 12 ++++++------
41 drivers/hwmon/lm75.c | 10 +++++-----
42 drivers/hwmon/lm77.c | 10 +++++-----
43 drivers/hwmon/lm78.c | 18 +++++++++---------
44 drivers/hwmon/lm80.c | 10 +++++-----
45 drivers/hwmon/lm83.c | 10 +++++-----
46 drivers/hwmon/lm85.c | 10 +++++-----
47 drivers/hwmon/lm87.c | 10 +++++-----
48 drivers/hwmon/lm90.c | 10 +++++-----
49 drivers/hwmon/lm92.c | 10 +++++-----
50 drivers/hwmon/lm93.c | 10 +++++-----
51 drivers/hwmon/max1619.c | 10 +++++-----
52 drivers/hwmon/max6650.c | 10 +++++-----
53 drivers/hwmon/pc87360.c | 10 +++++-----
54 drivers/hwmon/pc87427.c | 10 +++++-----
55 drivers/hwmon/sis5595.c | 10 +++++-----
56 drivers/hwmon/smsc47b397.c | 10 +++++-----
57 drivers/hwmon/smsc47m1.c | 10 +++++-----
58 drivers/hwmon/smsc47m192.c | 10 +++++-----
59 drivers/hwmon/thmc50.c | 10 +++++-----
60 drivers/hwmon/via686a.c | 10 +++++-----
61 drivers/hwmon/vt1211.c | 10 +++++-----
62 drivers/hwmon/vt8231.c | 10 +++++-----
63 drivers/hwmon/w83627ehf.c | 10 +++++-----
64 drivers/hwmon/w83627hf.c | 10 +++++-----
65 drivers/hwmon/w83781d.c | 18 +++++++++---------
66 drivers/hwmon/w83791d.c | 10 +++++-----
67 drivers/hwmon/w83792d.c | 10 +++++-----
68 drivers/hwmon/w83793.c | 10 +++++-----
69 drivers/hwmon/w83l785ts.c | 10 +++++-----
70 drivers/input/touchscreen/ads7846.c | 4 ++--
71 drivers/misc/thinkpad_acpi.c | 2 +-
72 drivers/misc/thinkpad_acpi.h | 2 +-
73 include/linux/hwmon.h | 4 ++--
74 61 files changed, 308 insertions(+), 309 deletions(-)
76 diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
77 index d575ee9..719151a 100644
78 --- a/drivers/hwmon/abituguru.c
79 +++ b/drivers/hwmon/abituguru.c
80 @@ -176,7 +176,7 @@ MODULE_PARM_DESC(verbose, "How verbose should the driver be? (0-3):\n"
81 The structure is dynamically allocated, at the same time when a new
82 abituguru device is allocated. */
83 struct abituguru_data {
84 - struct class_device *class_dev; /* hwmon registered device */
85 + struct device *hwmon_dev; /* hwmon registered device */
86 struct mutex update_lock; /* protect access to data and uGuru */
87 unsigned long last_updated; /* In jiffies */
88 unsigned short addr; /* uguru base address */
89 @@ -1287,11 +1287,11 @@ static int __devinit abituguru_probe(struct platform_device *pdev)
90 &abituguru_sysfs_attr[i].dev_attr))
91 goto abituguru_probe_error;
93 - data->class_dev = hwmon_device_register(&pdev->dev);
94 - if (!IS_ERR(data->class_dev))
95 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
96 + if (!IS_ERR(data->hwmon_dev))
97 return 0; /* success */
99 - res = PTR_ERR(data->class_dev);
100 + res = PTR_ERR(data->hwmon_dev);
101 abituguru_probe_error:
102 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++)
103 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr);
104 @@ -1308,7 +1308,7 @@ static int __devexit abituguru_remove(struct platform_device *pdev)
105 int i;
106 struct abituguru_data *data = platform_get_drvdata(pdev);
108 - hwmon_device_unregister(data->class_dev);
109 + hwmon_device_unregister(data->hwmon_dev);
110 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++)
111 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr);
112 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++)
113 diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
114 index cdd8b6d..cb2331b 100644
115 --- a/drivers/hwmon/abituguru3.c
116 +++ b/drivers/hwmon/abituguru3.c
117 @@ -124,7 +124,7 @@ struct abituguru3_motherboard_info {
118 The structure is dynamically allocated, at the same time when a new
119 abituguru3 device is allocated. */
120 struct abituguru3_data {
121 - struct class_device *class_dev; /* hwmon registered device */
122 + struct device *hwmon_dev; /* hwmon registered device */
123 struct mutex update_lock; /* protect access to data and uGuru */
124 unsigned short addr; /* uguru base address */
125 char valid; /* !=0 if following fields are valid */
126 @@ -933,9 +933,9 @@ static int __devinit abituguru3_probe(struct platform_device *pdev)
127 &abituguru3_sysfs_attr[i].dev_attr))
128 goto abituguru3_probe_error;
130 - data->class_dev = hwmon_device_register(&pdev->dev);
131 - if (IS_ERR(data->class_dev)) {
132 - res = PTR_ERR(data->class_dev);
133 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
134 + if (IS_ERR(data->hwmon_dev)) {
135 + res = PTR_ERR(data->hwmon_dev);
136 goto abituguru3_probe_error;
139 @@ -957,7 +957,7 @@ static int __devexit abituguru3_remove(struct platform_device *pdev)
140 struct abituguru3_data *data = platform_get_drvdata(pdev);
142 platform_set_drvdata(pdev, NULL);
143 - hwmon_device_unregister(data->class_dev);
144 + hwmon_device_unregister(data->hwmon_dev);
145 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++)
146 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr);
147 for (i = 0; i < ARRAY_SIZE(abituguru3_sysfs_attr); i++)
148 diff --git a/drivers/hwmon/ad7418.c b/drivers/hwmon/ad7418.c
149 index 879ea72..fcd7fe7 100644
150 --- a/drivers/hwmon/ad7418.c
151 +++ b/drivers/hwmon/ad7418.c
152 @@ -47,7 +47,7 @@ static const u8 AD7418_REG_TEMP[] = { AD7418_REG_TEMP_IN,
154 struct ad7418_data {
155 struct i2c_client client;
156 - struct class_device *class_dev;
157 + struct device *hwmon_dev;
158 struct attribute_group attrs;
159 enum chips type;
160 struct mutex lock;
161 @@ -326,9 +326,9 @@ static int ad7418_detect(struct i2c_adapter *adapter, int address, int kind)
162 if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))
163 goto exit_detach;
165 - data->class_dev = hwmon_device_register(&client->dev);
166 - if (IS_ERR(data->class_dev)) {
167 - err = PTR_ERR(data->class_dev);
168 + data->hwmon_dev = hwmon_device_register(&client->dev);
169 + if (IS_ERR(data->hwmon_dev)) {
170 + err = PTR_ERR(data->hwmon_dev);
171 goto exit_remove;
174 @@ -347,7 +347,7 @@ exit:
175 static int ad7418_detach_client(struct i2c_client *client)
177 struct ad7418_data *data = i2c_get_clientdata(client);
178 - hwmon_device_unregister(data->class_dev);
179 + hwmon_device_unregister(data->hwmon_dev);
180 sysfs_remove_group(&client->dev.kobj, &data->attrs);
181 i2c_detach_client(client);
182 kfree(data);
183 diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
184 index 6649e06..5667630 100644
185 --- a/drivers/hwmon/adm1021.c
186 +++ b/drivers/hwmon/adm1021.c
187 @@ -91,7 +91,7 @@ clearing it. Weird, ey? --Phil */
188 /* Each client has this additional data */
189 struct adm1021_data {
190 struct i2c_client client;
191 - struct class_device *class_dev;
192 + struct device *hwmon_dev;
193 enum chips type;
195 struct mutex update_lock;
196 @@ -319,9 +319,9 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind)
197 if ((err = sysfs_create_group(&client->dev.kobj, &adm1021_group)))
198 goto error2;
200 - data->class_dev = hwmon_device_register(&client->dev);
201 - if (IS_ERR(data->class_dev)) {
202 - err = PTR_ERR(data->class_dev);
203 + data->hwmon_dev = hwmon_device_register(&client->dev);
204 + if (IS_ERR(data->hwmon_dev)) {
205 + err = PTR_ERR(data->hwmon_dev);
206 goto error3;
209 @@ -351,7 +351,7 @@ static int adm1021_detach_client(struct i2c_client *client)
210 struct adm1021_data *data = i2c_get_clientdata(client);
211 int err;
213 - hwmon_device_unregister(data->class_dev);
214 + hwmon_device_unregister(data->hwmon_dev);
215 sysfs_remove_group(&client->dev.kobj, &adm1021_group);
217 if ((err = i2c_detach_client(client)))
218 diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c
219 index 8c56288..a67e133 100644
220 --- a/drivers/hwmon/adm1025.c
221 +++ b/drivers/hwmon/adm1025.c
222 @@ -133,7 +133,7 @@ static struct i2c_driver adm1025_driver = {
224 struct adm1025_data {
225 struct i2c_client client;
226 - struct class_device *class_dev;
227 + struct device *hwmon_dev;
228 struct mutex update_lock;
229 char valid; /* zero until following fields are valid */
230 unsigned long last_updated; /* in jiffies */
231 @@ -472,9 +472,9 @@ static int adm1025_detect(struct i2c_adapter *adapter, int address, int kind)
232 goto exit_remove;
235 - data->class_dev = hwmon_device_register(&new_client->dev);
236 - if (IS_ERR(data->class_dev)) {
237 - err = PTR_ERR(data->class_dev);
238 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
239 + if (IS_ERR(data->hwmon_dev)) {
240 + err = PTR_ERR(data->hwmon_dev);
241 goto exit_remove;
244 @@ -538,7 +538,7 @@ static int adm1025_detach_client(struct i2c_client *client)
245 struct adm1025_data *data = i2c_get_clientdata(client);
246 int err;
248 - hwmon_device_unregister(data->class_dev);
249 + hwmon_device_unregister(data->hwmon_dev);
250 sysfs_remove_group(&client->dev.kobj, &adm1025_group);
251 sysfs_remove_group(&client->dev.kobj, &adm1025_group_opt);
253 diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
254 index ba80cd3..b85370c 100644
255 --- a/drivers/hwmon/adm1026.c
256 +++ b/drivers/hwmon/adm1026.c
257 @@ -260,7 +260,7 @@ struct pwm_data {
259 struct adm1026_data {
260 struct i2c_client client;
261 - struct class_device *class_dev;
262 + struct device *hwmon_dev;
263 enum chips type;
265 struct mutex update_lock;
266 @@ -1676,9 +1676,9 @@ static int adm1026_detect(struct i2c_adapter *adapter, int address,
267 if ((err = sysfs_create_group(&new_client->dev.kobj, &adm1026_group)))
268 goto exitdetach;
270 - data->class_dev = hwmon_device_register(&new_client->dev);
271 - if (IS_ERR(data->class_dev)) {
272 - err = PTR_ERR(data->class_dev);
273 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
274 + if (IS_ERR(data->hwmon_dev)) {
275 + err = PTR_ERR(data->hwmon_dev);
276 goto exitremove;
279 @@ -1698,7 +1698,7 @@ exit:
280 static int adm1026_detach_client(struct i2c_client *client)
282 struct adm1026_data *data = i2c_get_clientdata(client);
283 - hwmon_device_unregister(data->class_dev);
284 + hwmon_device_unregister(data->hwmon_dev);
285 sysfs_remove_group(&client->dev.kobj, &adm1026_group);
286 i2c_detach_client(client);
287 kfree(data);
288 diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c
289 index 73ce31b..0bc897d 100644
290 --- a/drivers/hwmon/adm1029.c
291 +++ b/drivers/hwmon/adm1029.c
292 @@ -141,7 +141,7 @@ static struct i2c_driver adm1029_driver = {
294 struct adm1029_data {
295 struct i2c_client client;
296 - struct class_device *class_dev;
297 + struct device *hwmon_dev;
298 struct mutex update_lock;
299 char valid; /* zero until following fields are valid */
300 unsigned long last_updated; /* in jiffies */
301 @@ -391,9 +391,9 @@ static int adm1029_detect(struct i2c_adapter *adapter, int address, int kind)
302 if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group)))
303 goto exit_detach;
305 - data->class_dev = hwmon_device_register(&client->dev);
306 - if (IS_ERR(data->class_dev)) {
307 - err = PTR_ERR(data->class_dev);
308 + data->hwmon_dev = hwmon_device_register(&client->dev);
309 + if (IS_ERR(data->hwmon_dev)) {
310 + err = PTR_ERR(data->hwmon_dev);
311 goto exit_remove_files;
314 @@ -431,7 +431,7 @@ static int adm1029_detach_client(struct i2c_client *client)
315 struct adm1029_data *data = i2c_get_clientdata(client);
316 int err;
318 - hwmon_device_unregister(data->class_dev);
319 + hwmon_device_unregister(data->hwmon_dev);
320 sysfs_remove_group(&client->dev.kobj, &adm1029_group);
322 if ((err = i2c_detach_client(client)))
323 diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c
324 index 122683f..37cfc10 100644
325 --- a/drivers/hwmon/adm1031.c
326 +++ b/drivers/hwmon/adm1031.c
327 @@ -70,7 +70,7 @@ typedef u8 auto_chan_table_t[8][2];
328 /* Each client has this additional data */
329 struct adm1031_data {
330 struct i2c_client client;
331 - struct class_device *class_dev;
332 + struct device *hwmon_dev;
333 struct mutex update_lock;
334 int chip_type;
335 char valid; /* !=0 if following fields are valid */
336 @@ -853,9 +853,9 @@ static int adm1031_detect(struct i2c_adapter *adapter, int address, int kind)
337 goto exit_remove;
340 - data->class_dev = hwmon_device_register(&new_client->dev);
341 - if (IS_ERR(data->class_dev)) {
342 - err = PTR_ERR(data->class_dev);
343 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
344 + if (IS_ERR(data->hwmon_dev)) {
345 + err = PTR_ERR(data->hwmon_dev);
346 goto exit_remove;
349 @@ -877,7 +877,7 @@ static int adm1031_detach_client(struct i2c_client *client)
350 struct adm1031_data *data = i2c_get_clientdata(client);
351 int ret;
353 - hwmon_device_unregister(data->class_dev);
354 + hwmon_device_unregister(data->hwmon_dev);
355 sysfs_remove_group(&client->dev.kobj, &adm1031_group);
356 sysfs_remove_group(&client->dev.kobj, &adm1031_group_opt);
357 if ((ret = i2c_detach_client(client)) != 0) {
358 diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
359 index aad594a..c17d0b6 100644
360 --- a/drivers/hwmon/adm9240.c
361 +++ b/drivers/hwmon/adm9240.c
362 @@ -150,7 +150,7 @@ static struct i2c_driver adm9240_driver = {
363 struct adm9240_data {
364 enum chips type;
365 struct i2c_client client;
366 - struct class_device *class_dev;
367 + struct device *hwmon_dev;
368 struct mutex update_lock;
369 char valid;
370 unsigned long last_updated_measure;
371 @@ -590,9 +590,9 @@ static int adm9240_detect(struct i2c_adapter *adapter, int address, int kind)
372 if ((err = sysfs_create_group(&new_client->dev.kobj, &adm9240_group)))
373 goto exit_detach;
375 - data->class_dev = hwmon_device_register(&new_client->dev);
376 - if (IS_ERR(data->class_dev)) {
377 - err = PTR_ERR(data->class_dev);
378 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
379 + if (IS_ERR(data->hwmon_dev)) {
380 + err = PTR_ERR(data->hwmon_dev);
381 goto exit_remove;
384 @@ -620,7 +620,7 @@ static int adm9240_detach_client(struct i2c_client *client)
385 struct adm9240_data *data = i2c_get_clientdata(client);
386 int err;
388 - hwmon_device_unregister(data->class_dev);
389 + hwmon_device_unregister(data->hwmon_dev);
390 sysfs_remove_group(&client->dev.kobj, &adm9240_group);
392 if ((err = i2c_detach_client(client)))
393 diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
394 index c4dc205..9810aaa 100644
395 --- a/drivers/hwmon/adt7470.c
396 +++ b/drivers/hwmon/adt7470.c
397 @@ -124,7 +124,7 @@ I2C_CLIENT_INSMOD_1(adt7470);
399 struct adt7470_data {
400 struct i2c_client client;
401 - struct class_device *class_dev;
402 + struct device *hwmon_dev;
403 struct attribute_group attrs;
404 struct mutex lock;
405 char sensors_valid;
406 @@ -1003,9 +1003,9 @@ static int adt7470_detect(struct i2c_adapter *adapter, int address, int kind)
407 if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))
408 goto exit_detach;
410 - data->class_dev = hwmon_device_register(&client->dev);
411 - if (IS_ERR(data->class_dev)) {
412 - err = PTR_ERR(data->class_dev);
413 + data->hwmon_dev = hwmon_device_register(&client->dev);
414 + if (IS_ERR(data->hwmon_dev)) {
415 + err = PTR_ERR(data->hwmon_dev);
416 goto exit_remove;
419 @@ -1025,7 +1025,7 @@ static int adt7470_detach_client(struct i2c_client *client)
421 struct adt7470_data *data = i2c_get_clientdata(client);
423 - hwmon_device_unregister(data->class_dev);
424 + hwmon_device_unregister(data->hwmon_dev);
425 sysfs_remove_group(&client->dev.kobj, &data->attrs);
426 i2c_detach_client(client);
427 kfree(data);
428 diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
429 index 941729a..21ff8e1 100644
430 --- a/drivers/hwmon/applesmc.c
431 +++ b/drivers/hwmon/applesmc.c
432 @@ -127,7 +127,7 @@ static s16 rest_x;
433 static s16 rest_y;
434 static struct timer_list applesmc_timer;
435 static struct input_dev *applesmc_idev;
436 -static struct class_device *hwmon_class_dev;
437 +static struct device *hwmon_dev;
439 /* Indicates whether this computer has an accelerometer. */
440 static unsigned int applesmc_accelerometer;
441 @@ -1287,9 +1287,9 @@ static int __init applesmc_init(void)
442 goto out_light_wq;
445 - hwmon_class_dev = hwmon_device_register(&pdev->dev);
446 - if (IS_ERR(hwmon_class_dev)) {
447 - ret = PTR_ERR(hwmon_class_dev);
448 + hwmon_dev = hwmon_device_register(&pdev->dev);
449 + if (IS_ERR(hwmon_dev)) {
450 + ret = PTR_ERR(hwmon_dev);
451 goto out_light_ledclass;
454 @@ -1331,7 +1331,7 @@ out:
456 static void __exit applesmc_exit(void)
458 - hwmon_device_unregister(hwmon_class_dev);
459 + hwmon_device_unregister(hwmon_dev);
460 if (applesmc_light) {
461 led_classdev_unregister(&applesmc_backlight);
462 destroy_workqueue(applesmc_led_wq);
463 diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
464 index 55d92e1..745bf26 100644
465 --- a/drivers/hwmon/asb100.c
466 +++ b/drivers/hwmon/asb100.c
467 @@ -182,7 +182,7 @@ static u8 DIV_TO_REG(long val)
468 dynamically allocated, at the same time the client itself is allocated. */
469 struct asb100_data {
470 struct i2c_client client;
471 - struct class_device *class_dev;
472 + struct device *hwmon_dev;
473 struct mutex lock;
474 enum chips type;
476 @@ -844,9 +844,9 @@ static int asb100_detect(struct i2c_adapter *adapter, int address, int kind)
477 if ((err = sysfs_create_group(&new_client->dev.kobj, &asb100_group)))
478 goto ERROR3;
480 - data->class_dev = hwmon_device_register(&new_client->dev);
481 - if (IS_ERR(data->class_dev)) {
482 - err = PTR_ERR(data->class_dev);
483 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
484 + if (IS_ERR(data->hwmon_dev)) {
485 + err = PTR_ERR(data->hwmon_dev);
486 goto ERROR4;
489 @@ -874,7 +874,7 @@ static int asb100_detach_client(struct i2c_client *client)
491 /* main client */
492 if (data) {
493 - hwmon_device_unregister(data->class_dev);
494 + hwmon_device_unregister(data->hwmon_dev);
495 sysfs_remove_group(&client->dev.kobj, &asb100_group);
498 diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c
499 index 0ccdd07..cce3350 100644
500 --- a/drivers/hwmon/atxp1.c
501 +++ b/drivers/hwmon/atxp1.c
502 @@ -61,7 +61,7 @@ static struct i2c_driver atxp1_driver = {
504 struct atxp1_data {
505 struct i2c_client client;
506 - struct class_device *class_dev;
507 + struct device *hwmon_dev;
508 struct mutex update_lock;
509 unsigned long last_updated;
510 u8 valid;
511 @@ -335,9 +335,9 @@ static int atxp1_detect(struct i2c_adapter *adapter, int address, int kind)
512 if ((err = sysfs_create_group(&new_client->dev.kobj, &atxp1_group)))
513 goto exit_detach;
515 - data->class_dev = hwmon_device_register(&new_client->dev);
516 - if (IS_ERR(data->class_dev)) {
517 - err = PTR_ERR(data->class_dev);
518 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
519 + if (IS_ERR(data->hwmon_dev)) {
520 + err = PTR_ERR(data->hwmon_dev);
521 goto exit_remove_files;
524 @@ -361,7 +361,7 @@ static int atxp1_detach_client(struct i2c_client * client)
525 struct atxp1_data * data = i2c_get_clientdata(client);
526 int err;
528 - hwmon_device_unregister(data->class_dev);
529 + hwmon_device_unregister(data->hwmon_dev);
530 sysfs_remove_group(&client->dev.kobj, &atxp1_group);
532 err = i2c_detach_client(client);
533 diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
534 index f7b0ef4..1a0ff8d 100644
535 --- a/drivers/hwmon/coretemp.c
536 +++ b/drivers/hwmon/coretemp.c
537 @@ -47,7 +47,7 @@ typedef enum { SHOW_TEMP, SHOW_TJMAX, SHOW_LABEL, SHOW_NAME } SHOW;
538 static struct coretemp_data *coretemp_update_device(struct device *dev);
540 struct coretemp_data {
541 - struct class_device *class_dev;
542 + struct device *hwmon_dev;
543 struct mutex update_lock;
544 const char *name;
545 u32 id;
546 @@ -226,9 +226,9 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
547 if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
548 goto exit_free;
550 - data->class_dev = hwmon_device_register(&pdev->dev);
551 - if (IS_ERR(data->class_dev)) {
552 - err = PTR_ERR(data->class_dev);
553 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
554 + if (IS_ERR(data->hwmon_dev)) {
555 + err = PTR_ERR(data->hwmon_dev);
556 dev_err(&pdev->dev, "Class registration failed (%d)\n",
557 err);
558 goto exit_class;
559 @@ -248,7 +248,7 @@ static int __devexit coretemp_remove(struct platform_device *pdev)
561 struct coretemp_data *data = platform_get_drvdata(pdev);
563 - hwmon_device_unregister(data->class_dev);
564 + hwmon_device_unregister(data->hwmon_dev);
565 sysfs_remove_group(&pdev->dev.kobj, &coretemp_group);
566 platform_set_drvdata(pdev, NULL);
567 kfree(data);
568 diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
569 index e9cbc72..14ebbfb 100644
570 --- a/drivers/hwmon/dme1737.c
571 +++ b/drivers/hwmon/dme1737.c
572 @@ -155,7 +155,7 @@ static const u8 DME1737_BIT_ALARM_FAN[] = {10, 11, 12, 13, 22, 23};
574 struct dme1737_data {
575 struct i2c_client client;
576 - struct class_device *class_dev;
577 + struct device *hwmon_dev;
579 struct mutex update_lock;
580 int valid; /* !=0 if following fields are valid */
581 @@ -1983,9 +1983,9 @@ static int dme1737_detect(struct i2c_adapter *adapter, int address,
584 /* Register device */
585 - data->class_dev = hwmon_device_register(&client->dev);
586 - if (IS_ERR(data->class_dev)) {
587 - err = PTR_ERR(data->class_dev);
588 + data->hwmon_dev = hwmon_device_register(&client->dev);
589 + if (IS_ERR(data->hwmon_dev)) {
590 + err = PTR_ERR(data->hwmon_dev);
591 goto exit_remove;
594 @@ -2030,7 +2030,7 @@ static int dme1737_detach_client(struct i2c_client *client)
595 struct dme1737_data *data = i2c_get_clientdata(client);
596 int ix, err;
598 - hwmon_device_unregister(data->class_dev);
599 + hwmon_device_unregister(data->hwmon_dev);
601 for (ix = 0; ix < ARRAY_SIZE(dme1737_fan_group); ix++) {
602 if (data->has_fan & (1 << ix)) {
603 diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
604 index 5a861f9..b7bd000 100644
605 --- a/drivers/hwmon/ds1621.c
606 +++ b/drivers/hwmon/ds1621.c
607 @@ -73,7 +73,7 @@ static const u8 DS1621_REG_TEMP[3] = {
608 /* Each client has this additional data */
609 struct ds1621_data {
610 struct i2c_client client;
611 - struct class_device *class_dev;
612 + struct device *hwmon_dev;
613 struct mutex update_lock;
614 char valid; /* !=0 if following fields are valid */
615 unsigned long last_updated; /* In jiffies */
616 @@ -266,9 +266,9 @@ static int ds1621_detect(struct i2c_adapter *adapter, int address,
617 if ((err = sysfs_create_group(&client->dev.kobj, &ds1621_group)))
618 goto exit_detach;
620 - data->class_dev = hwmon_device_register(&client->dev);
621 - if (IS_ERR(data->class_dev)) {
622 - err = PTR_ERR(data->class_dev);
623 + data->hwmon_dev = hwmon_device_register(&client->dev);
624 + if (IS_ERR(data->hwmon_dev)) {
625 + err = PTR_ERR(data->hwmon_dev);
626 goto exit_remove_files;
629 @@ -289,7 +289,7 @@ static int ds1621_detach_client(struct i2c_client *client)
630 struct ds1621_data *data = i2c_get_clientdata(client);
631 int err;
633 - hwmon_device_unregister(data->class_dev);
634 + hwmon_device_unregister(data->hwmon_dev);
635 sysfs_remove_group(&client->dev.kobj, &ds1621_group);
637 if ((err = i2c_detach_client(client)))
638 diff --git a/drivers/hwmon/f71805f.c b/drivers/hwmon/f71805f.c
639 index 1cd71a5..5d9d5cc 100644
640 --- a/drivers/hwmon/f71805f.c
641 +++ b/drivers/hwmon/f71805f.c
642 @@ -162,7 +162,7 @@ struct f71805f_auto_point {
643 struct f71805f_data {
644 unsigned short addr;
645 const char *name;
646 - struct class_device *class_dev;
647 + struct device *hwmon_dev;
649 struct mutex update_lock;
650 char valid; /* !=0 if following fields are valid */
651 @@ -1381,9 +1381,9 @@ static int __devinit f71805f_probe(struct platform_device *pdev)
655 - data->class_dev = hwmon_device_register(&pdev->dev);
656 - if (IS_ERR(data->class_dev)) {
657 - err = PTR_ERR(data->class_dev);
658 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
659 + if (IS_ERR(data->hwmon_dev)) {
660 + err = PTR_ERR(data->hwmon_dev);
661 dev_err(&pdev->dev, "Class registration failed (%d)\n", err);
662 goto exit_remove_files;
664 @@ -1410,7 +1410,7 @@ static int __devexit f71805f_remove(struct platform_device *pdev)
665 struct resource *res;
666 int i;
668 - hwmon_device_unregister(data->class_dev);
669 + hwmon_device_unregister(data->hwmon_dev);
670 sysfs_remove_group(&pdev->dev.kobj, &f71805f_group);
671 for (i = 0; i < 4; i++)
672 sysfs_remove_group(&pdev->dev.kobj, &f71805f_group_optin[i]);
673 diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
674 index b4ff0f9..6db7443 100644
675 --- a/drivers/hwmon/f71882fg.c
676 +++ b/drivers/hwmon/f71882fg.c
677 @@ -87,7 +87,7 @@ static inline u16 fan_from_reg ( u16 reg );
679 struct f71882fg_data {
680 unsigned short addr;
681 - struct class_device *class_dev;
682 + struct device *hwmon_dev;
684 struct mutex update_lock;
685 char valid; /* !=0 if following fields are valid */
686 @@ -781,9 +781,9 @@ static int __devinit f71882fg_probe(struct platform_device * pdev)
690 - data->class_dev = hwmon_device_register(&pdev->dev);
691 - if (IS_ERR(data->class_dev)) {
692 - err = PTR_ERR(data->class_dev);
693 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
694 + if (IS_ERR(data->hwmon_dev)) {
695 + err = PTR_ERR(data->hwmon_dev);
696 goto exit_unregister_sysfs;
699 @@ -811,7 +811,7 @@ static int __devexit f71882fg_remove(struct platform_device *pdev)
700 struct f71882fg_data *data = platform_get_drvdata(pdev);
702 platform_set_drvdata(pdev, NULL);
703 - hwmon_device_unregister(data->class_dev);
704 + hwmon_device_unregister(data->hwmon_dev);
706 for (i = 0; i < ARRAY_SIZE(f71882fg_dev_attr); i++)
707 device_remove_file(&pdev->dev, &f71882fg_dev_attr[i]);
708 diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
709 index 6425184..13a0413 100644
710 --- a/drivers/hwmon/f75375s.c
711 +++ b/drivers/hwmon/f75375s.c
712 @@ -87,7 +87,7 @@ I2C_CLIENT_INSMOD_2(f75373, f75375);
713 struct f75375_data {
714 unsigned short addr;
715 struct i2c_client client;
716 - struct class_device *class_dev;
717 + struct device *hwmon_dev;
719 const char *name;
720 int kind;
721 @@ -583,7 +583,7 @@ static int f75375_detach_client(struct i2c_client *client)
722 struct f75375_data *data = i2c_get_clientdata(client);
723 int err;
725 - hwmon_device_unregister(data->class_dev);
726 + hwmon_device_unregister(data->hwmon_dev);
727 sysfs_remove_group(&client->dev.kobj, &f75375_group);
729 err = i2c_detach_client(client);
730 @@ -655,9 +655,9 @@ static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
731 if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
732 goto exit_detach;
734 - data->class_dev = hwmon_device_register(&client->dev);
735 - if (IS_ERR(data->class_dev)) {
736 - err = PTR_ERR(data->class_dev);
737 + data->hwmon_dev = hwmon_device_register(&client->dev);
738 + if (IS_ERR(data->hwmon_dev)) {
739 + err = PTR_ERR(data->hwmon_dev);
740 goto exit_remove;
743 diff --git a/drivers/hwmon/fscher.c b/drivers/hwmon/fscher.c
744 index b34b546..e67c369 100644
745 --- a/drivers/hwmon/fscher.c
746 +++ b/drivers/hwmon/fscher.c
747 @@ -134,7 +134,7 @@ static struct i2c_driver fscher_driver = {
749 struct fscher_data {
750 struct i2c_client client;
751 - struct class_device *class_dev;
752 + struct device *hwmon_dev;
753 struct mutex update_lock;
754 char valid; /* zero until following fields are valid */
755 unsigned long last_updated; /* in jiffies */
756 @@ -344,9 +344,9 @@ static int fscher_detect(struct i2c_adapter *adapter, int address, int kind)
757 if ((err = sysfs_create_group(&new_client->dev.kobj, &fscher_group)))
758 goto exit_detach;
760 - data->class_dev = hwmon_device_register(&new_client->dev);
761 - if (IS_ERR(data->class_dev)) {
762 - err = PTR_ERR(data->class_dev);
763 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
764 + if (IS_ERR(data->hwmon_dev)) {
765 + err = PTR_ERR(data->hwmon_dev);
766 goto exit_remove_files;
769 @@ -367,7 +367,7 @@ static int fscher_detach_client(struct i2c_client *client)
770 struct fscher_data *data = i2c_get_clientdata(client);
771 int err;
773 - hwmon_device_unregister(data->class_dev);
774 + hwmon_device_unregister(data->hwmon_dev);
775 sysfs_remove_group(&client->dev.kobj, &fscher_group);
777 if ((err = i2c_detach_client(client)))
778 diff --git a/drivers/hwmon/fscpos.c b/drivers/hwmon/fscpos.c
779 index ea506a7..92c9703 100644
780 --- a/drivers/hwmon/fscpos.c
781 +++ b/drivers/hwmon/fscpos.c
782 @@ -115,7 +115,7 @@ static struct i2c_driver fscpos_driver = {
784 struct fscpos_data {
785 struct i2c_client client;
786 - struct class_device *class_dev;
787 + struct device *hwmon_dev;
788 struct mutex update_lock;
789 char valid; /* 0 until following fields are valid */
790 unsigned long last_updated; /* In jiffies */
791 @@ -539,9 +539,9 @@ static int fscpos_detect(struct i2c_adapter *adapter, int address, int kind)
792 if ((err = sysfs_create_group(&new_client->dev.kobj, &fscpos_group)))
793 goto exit_detach;
795 - data->class_dev = hwmon_device_register(&new_client->dev);
796 - if (IS_ERR(data->class_dev)) {
797 - err = PTR_ERR(data->class_dev);
798 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
799 + if (IS_ERR(data->hwmon_dev)) {
800 + err = PTR_ERR(data->hwmon_dev);
801 goto exit_remove_files;
804 @@ -562,7 +562,7 @@ static int fscpos_detach_client(struct i2c_client *client)
805 struct fscpos_data *data = i2c_get_clientdata(client);
806 int err;
808 - hwmon_device_unregister(data->class_dev);
809 + hwmon_device_unregister(data->hwmon_dev);
810 sysfs_remove_group(&client->dev.kobj, &fscpos_group);
812 if ((err = i2c_detach_client(client)))
813 diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c
814 index c103640..bb58d98 100644
815 --- a/drivers/hwmon/gl518sm.c
816 +++ b/drivers/hwmon/gl518sm.c
817 @@ -119,7 +119,7 @@ static inline u8 FAN_TO_REG(long rpm, int div)
818 /* Each client has this additional data */
819 struct gl518_data {
820 struct i2c_client client;
821 - struct class_device *class_dev;
822 + struct device *hwmon_dev;
823 enum chips type;
825 struct mutex update_lock;
826 @@ -460,9 +460,9 @@ static int gl518_detect(struct i2c_adapter *adapter, int address, int kind)
827 if ((err = sysfs_create_group(&new_client->dev.kobj, &gl518_group)))
828 goto exit_detach;
830 - data->class_dev = hwmon_device_register(&new_client->dev);
831 - if (IS_ERR(data->class_dev)) {
832 - err = PTR_ERR(data->class_dev);
833 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
834 + if (IS_ERR(data->hwmon_dev)) {
835 + err = PTR_ERR(data->hwmon_dev);
836 goto exit_remove_files;
839 @@ -502,7 +502,7 @@ static int gl518_detach_client(struct i2c_client *client)
840 struct gl518_data *data = i2c_get_clientdata(client);
841 int err;
843 - hwmon_device_unregister(data->class_dev);
844 + hwmon_device_unregister(data->hwmon_dev);
845 sysfs_remove_group(&client->dev.kobj, &gl518_group);
847 if ((err = i2c_detach_client(client)))
848 diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c
849 index ebe7b9a..a3b56c8 100644
850 --- a/drivers/hwmon/gl520sm.c
851 +++ b/drivers/hwmon/gl520sm.c
852 @@ -122,7 +122,7 @@ static struct i2c_driver gl520_driver = {
853 /* Client data */
854 struct gl520_data {
855 struct i2c_client client;
856 - struct class_device *class_dev;
857 + struct device *hwmon_dev;
858 struct mutex update_lock;
859 char valid; /* zero until the following fields are valid */
860 unsigned long last_updated; /* in jiffies */
861 @@ -622,9 +622,9 @@ static int gl520_detect(struct i2c_adapter *adapter, int address, int kind)
865 - data->class_dev = hwmon_device_register(&new_client->dev);
866 - if (IS_ERR(data->class_dev)) {
867 - err = PTR_ERR(data->class_dev);
868 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
869 + if (IS_ERR(data->hwmon_dev)) {
870 + err = PTR_ERR(data->hwmon_dev);
871 goto exit_remove_files;
874 @@ -685,7 +685,7 @@ static int gl520_detach_client(struct i2c_client *client)
875 struct gl520_data *data = i2c_get_clientdata(client);
876 int err;
878 - hwmon_device_unregister(data->class_dev);
879 + hwmon_device_unregister(data->hwmon_dev);
880 sysfs_remove_group(&client->dev.kobj, &gl520_group);
881 sysfs_remove_group(&client->dev.kobj, &gl520_group_opt);
883 diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
884 index affcc00..3db2845 100644
885 --- a/drivers/hwmon/hwmon.c
886 +++ b/drivers/hwmon/hwmon.c
887 @@ -28,17 +28,17 @@ static DEFINE_IDR(hwmon_idr);
888 static DEFINE_SPINLOCK(idr_lock);
891 - * hwmon_device_register - register w/ hwmon sysfs class
892 + * hwmon_device_register - register w/ hwmon
893 * @dev: the device to register
895 - * hwmon_device_unregister() must be called when the class device is no
896 + * hwmon_device_unregister() must be called when the device is no
897 * longer needed.
899 - * Returns the pointer to the new struct class device.
900 + * Returns the pointer to the new device.
902 -struct class_device *hwmon_device_register(struct device *dev)
903 +struct device *hwmon_device_register(struct device *dev)
905 - struct class_device *cdev;
906 + struct device *hwdev;
907 int id, err;
909 again:
910 @@ -55,34 +55,33 @@ again:
911 return ERR_PTR(err);
913 id = id & MAX_ID_MASK;
914 - cdev = class_device_create(hwmon_class, NULL, MKDEV(0,0), dev,
915 - HWMON_ID_FORMAT, id);
916 + hwdev = device_create(hwmon_class, dev, MKDEV(0,0), HWMON_ID_FORMAT, id);
918 - if (IS_ERR(cdev)) {
919 + if (IS_ERR(hwdev)) {
920 spin_lock(&idr_lock);
921 idr_remove(&hwmon_idr, id);
922 spin_unlock(&idr_lock);
925 - return cdev;
926 + return hwdev;
930 * hwmon_device_unregister - removes the previously registered class device
932 - * @cdev: the class device to destroy
933 + * @dev: the class device to destroy
935 -void hwmon_device_unregister(struct class_device *cdev)
936 +void hwmon_device_unregister(struct device *dev)
938 int id;
940 - if (likely(sscanf(cdev->class_id, HWMON_ID_FORMAT, &id) == 1)) {
941 - class_device_unregister(cdev);
942 + if (likely(sscanf(dev->bus_id, HWMON_ID_FORMAT, &id) == 1)) {
943 + device_unregister(dev);
944 spin_lock(&idr_lock);
945 idr_remove(&hwmon_idr, id);
946 spin_unlock(&idr_lock);
947 } else
948 - dev_dbg(cdev->dev,
949 + dev_dbg(dev->parent,
950 "hwmon_device_unregister() failed: bad class ID!\n");
953 diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
954 index d75dba9..41a90e5 100644
955 --- a/drivers/hwmon/it87.c
956 +++ b/drivers/hwmon/it87.c
957 @@ -222,7 +222,7 @@ struct it87_sio_data {
958 /* For each registered chip, we need to keep some data in memory.
959 The structure is dynamically allocated. */
960 struct it87_data {
961 - struct class_device *class_dev;
962 + struct device *hwmon_dev;
963 enum chips type;
965 unsigned short addr;
966 @@ -1089,9 +1089,9 @@ static int __devinit it87_probe(struct platform_device *pdev)
967 goto ERROR4;
970 - data->class_dev = hwmon_device_register(dev);
971 - if (IS_ERR(data->class_dev)) {
972 - err = PTR_ERR(data->class_dev);
973 + data->hwmon_dev = hwmon_device_register(dev);
974 + if (IS_ERR(data->hwmon_dev)) {
975 + err = PTR_ERR(data->hwmon_dev);
976 goto ERROR4;
979 @@ -1113,7 +1113,7 @@ static int __devexit it87_remove(struct platform_device *pdev)
981 struct it87_data *data = platform_get_drvdata(pdev);
983 - hwmon_device_unregister(data->class_dev);
984 + hwmon_device_unregister(data->hwmon_dev);
985 sysfs_remove_group(&pdev->dev.kobj, &it87_group);
986 sysfs_remove_group(&pdev->dev.kobj, &it87_group_opt);
988 diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
989 index 5d8d0ca..bd2bde0 100644
990 --- a/drivers/hwmon/k8temp.c
991 +++ b/drivers/hwmon/k8temp.c
992 @@ -38,7 +38,7 @@
993 #define SEL_CORE 0x04
995 struct k8temp_data {
996 - struct class_device *class_dev;
997 + struct device *hwmon_dev;
998 struct mutex update_lock;
999 const char *name;
1000 char valid; /* zero until following fields are valid */
1001 @@ -225,10 +225,10 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
1002 if (err)
1003 goto exit_remove;
1005 - data->class_dev = hwmon_device_register(&pdev->dev);
1006 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
1008 - if (IS_ERR(data->class_dev)) {
1009 - err = PTR_ERR(data->class_dev);
1010 + if (IS_ERR(data->hwmon_dev)) {
1011 + err = PTR_ERR(data->hwmon_dev);
1012 goto exit_remove;
1015 @@ -255,7 +255,7 @@ static void __devexit k8temp_remove(struct pci_dev *pdev)
1017 struct k8temp_data *data = dev_get_drvdata(&pdev->dev);
1019 - hwmon_device_unregister(data->class_dev);
1020 + hwmon_device_unregister(data->hwmon_dev);
1021 device_remove_file(&pdev->dev,
1022 &sensor_dev_attr_temp1_input.dev_attr);
1023 device_remove_file(&pdev->dev,
1024 diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
1025 index 2162d69..f207434 100644
1026 --- a/drivers/hwmon/lm63.c
1027 +++ b/drivers/hwmon/lm63.c
1028 @@ -154,7 +154,7 @@ static struct i2c_driver lm63_driver = {
1030 struct lm63_data {
1031 struct i2c_client client;
1032 - struct class_device *class_dev;
1033 + struct device *hwmon_dev;
1034 struct mutex update_lock;
1035 char valid; /* zero until following fields are valid */
1036 unsigned long last_updated; /* in jiffies */
1037 @@ -502,9 +502,9 @@ static int lm63_detect(struct i2c_adapter *adapter, int address, int kind)
1038 goto exit_remove_files;
1041 - data->class_dev = hwmon_device_register(&new_client->dev);
1042 - if (IS_ERR(data->class_dev)) {
1043 - err = PTR_ERR(data->class_dev);
1044 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1045 + if (IS_ERR(data->hwmon_dev)) {
1046 + err = PTR_ERR(data->hwmon_dev);
1047 goto exit_remove_files;
1050 @@ -561,7 +561,7 @@ static int lm63_detach_client(struct i2c_client *client)
1051 struct lm63_data *data = i2c_get_clientdata(client);
1052 int err;
1054 - hwmon_device_unregister(data->class_dev);
1055 + hwmon_device_unregister(data->hwmon_dev);
1056 sysfs_remove_group(&client->dev.kobj, &lm63_group);
1057 sysfs_remove_group(&client->dev.kobj, &lm63_group_fan1);
1059 diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
1060 index 30b9b2b..dd36688 100644
1061 --- a/drivers/hwmon/lm70.c
1062 +++ b/drivers/hwmon/lm70.c
1063 @@ -37,7 +37,7 @@
1064 #define DRVNAME "lm70"
1066 struct lm70 {
1067 - struct class_device *cdev;
1068 + struct device *hwmon_dev;
1069 struct semaphore sem;
1072 @@ -115,10 +115,10 @@ static int __devinit lm70_probe(struct spi_device *spi)
1073 init_MUTEX(&p_lm70->sem);
1075 /* sysfs hook */
1076 - p_lm70->cdev = hwmon_device_register(&spi->dev);
1077 - if (IS_ERR(p_lm70->cdev)) {
1078 + p_lm70->hwmon_dev = hwmon_device_register(&spi->dev);
1079 + if (IS_ERR(p_lm70->hwmon_dev)) {
1080 dev_dbg(&spi->dev, "hwmon_device_register failed.\n");
1081 - status = PTR_ERR(p_lm70->cdev);
1082 + status = PTR_ERR(p_lm70->hwmon_dev);
1083 goto out_dev_reg_failed;
1085 dev_set_drvdata(&spi->dev, p_lm70);
1086 @@ -133,7 +133,7 @@ static int __devinit lm70_probe(struct spi_device *spi)
1088 out_dev_create_file_failed:
1089 device_remove_file(&spi->dev, &dev_attr_temp1_input);
1090 - hwmon_device_unregister(p_lm70->cdev);
1091 + hwmon_device_unregister(p_lm70->hwmon_dev);
1092 out_dev_reg_failed:
1093 dev_set_drvdata(&spi->dev, NULL);
1094 kfree(p_lm70);
1095 @@ -146,7 +146,7 @@ static int __devexit lm70_remove(struct spi_device *spi)
1097 device_remove_file(&spi->dev, &dev_attr_temp1_input);
1098 device_remove_file(&spi->dev, &dev_attr_name);
1099 - hwmon_device_unregister(p_lm70->cdev);
1100 + hwmon_device_unregister(p_lm70->hwmon_dev);
1101 dev_set_drvdata(&spi->dev, NULL);
1102 kfree(p_lm70);
1104 diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
1105 index 4fa3220..37a8cc0 100644
1106 --- a/drivers/hwmon/lm75.c
1107 +++ b/drivers/hwmon/lm75.c
1108 @@ -50,7 +50,7 @@ static const u8 LM75_REG_TEMP[3] = {
1109 /* Each client has this additional data */
1110 struct lm75_data {
1111 struct i2c_client client;
1112 - struct class_device *class_dev;
1113 + struct device *hwmon_dev;
1114 struct mutex update_lock;
1115 char valid; /* !=0 if following fields are valid */
1116 unsigned long last_updated; /* In jiffies */
1117 @@ -219,9 +219,9 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
1118 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm75_group)))
1119 goto exit_detach;
1121 - data->class_dev = hwmon_device_register(&new_client->dev);
1122 - if (IS_ERR(data->class_dev)) {
1123 - err = PTR_ERR(data->class_dev);
1124 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1125 + if (IS_ERR(data->hwmon_dev)) {
1126 + err = PTR_ERR(data->hwmon_dev);
1127 goto exit_remove;
1130 @@ -240,7 +240,7 @@ exit:
1131 static int lm75_detach_client(struct i2c_client *client)
1133 struct lm75_data *data = i2c_get_clientdata(client);
1134 - hwmon_device_unregister(data->class_dev);
1135 + hwmon_device_unregister(data->hwmon_dev);
1136 sysfs_remove_group(&client->dev.kobj, &lm75_group);
1137 i2c_detach_client(client);
1138 kfree(data);
1139 diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c
1140 index 46e3aba..cee5c2e 100644
1141 --- a/drivers/hwmon/lm77.c
1142 +++ b/drivers/hwmon/lm77.c
1143 @@ -51,7 +51,7 @@ I2C_CLIENT_INSMOD_1(lm77);
1144 /* Each client has this additional data */
1145 struct lm77_data {
1146 struct i2c_client client;
1147 - struct class_device *class_dev;
1148 + struct device *hwmon_dev;
1149 struct mutex update_lock;
1150 char valid;
1151 unsigned long last_updated; /* In jiffies */
1152 @@ -337,9 +337,9 @@ static int lm77_detect(struct i2c_adapter *adapter, int address, int kind)
1153 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm77_group)))
1154 goto exit_detach;
1156 - data->class_dev = hwmon_device_register(&new_client->dev);
1157 - if (IS_ERR(data->class_dev)) {
1158 - err = PTR_ERR(data->class_dev);
1159 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1160 + if (IS_ERR(data->hwmon_dev)) {
1161 + err = PTR_ERR(data->hwmon_dev);
1162 goto exit_remove;
1165 @@ -358,7 +358,7 @@ exit:
1166 static int lm77_detach_client(struct i2c_client *client)
1168 struct lm77_data *data = i2c_get_clientdata(client);
1169 - hwmon_device_unregister(data->class_dev);
1170 + hwmon_device_unregister(data->hwmon_dev);
1171 sysfs_remove_group(&client->dev.kobj, &lm77_group);
1172 i2c_detach_client(client);
1173 kfree(data);
1174 diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
1175 index 6eea347..f5278fd 100644
1176 --- a/drivers/hwmon/lm78.c
1177 +++ b/drivers/hwmon/lm78.c
1178 @@ -131,7 +131,7 @@ static inline int TEMP_FROM_REG(s8 val)
1179 the driver field to differentiate between I2C and ISA chips. */
1180 struct lm78_data {
1181 struct i2c_client client;
1182 - struct class_device *class_dev;
1183 + struct device *hwmon_dev;
1184 struct mutex lock;
1185 enum chips type;
1187 @@ -585,9 +585,9 @@ static int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
1188 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm78_group)))
1189 goto ERROR3;
1191 - data->class_dev = hwmon_device_register(&new_client->dev);
1192 - if (IS_ERR(data->class_dev)) {
1193 - err = PTR_ERR(data->class_dev);
1194 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1195 + if (IS_ERR(data->hwmon_dev)) {
1196 + err = PTR_ERR(data->hwmon_dev);
1197 goto ERROR4;
1200 @@ -608,7 +608,7 @@ static int lm78_detach_client(struct i2c_client *client)
1201 struct lm78_data *data = i2c_get_clientdata(client);
1202 int err;
1204 - hwmon_device_unregister(data->class_dev);
1205 + hwmon_device_unregister(data->hwmon_dev);
1206 sysfs_remove_group(&client->dev.kobj, &lm78_group);
1208 if ((err = i2c_detach_client(client)))
1209 @@ -659,9 +659,9 @@ static int __devinit lm78_isa_probe(struct platform_device *pdev)
1210 || (err = device_create_file(&pdev->dev, &dev_attr_name)))
1211 goto exit_remove_files;
1213 - data->class_dev = hwmon_device_register(&pdev->dev);
1214 - if (IS_ERR(data->class_dev)) {
1215 - err = PTR_ERR(data->class_dev);
1216 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
1217 + if (IS_ERR(data->hwmon_dev)) {
1218 + err = PTR_ERR(data->hwmon_dev);
1219 goto exit_remove_files;
1222 @@ -681,7 +681,7 @@ static int __devexit lm78_isa_remove(struct platform_device *pdev)
1224 struct lm78_data *data = platform_get_drvdata(pdev);
1226 - hwmon_device_unregister(data->class_dev);
1227 + hwmon_device_unregister(data->hwmon_dev);
1228 sysfs_remove_group(&pdev->dev.kobj, &lm78_group);
1229 device_remove_file(&pdev->dev, &dev_attr_name);
1230 release_region(data->client.addr, LM78_EXTENT);
1231 diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c
1232 index 064516d..063cdba 100644
1233 --- a/drivers/hwmon/lm80.c
1234 +++ b/drivers/hwmon/lm80.c
1235 @@ -108,7 +108,7 @@ static inline long TEMP_FROM_REG(u16 temp)
1237 struct lm80_data {
1238 struct i2c_client client;
1239 - struct class_device *class_dev;
1240 + struct device *hwmon_dev;
1241 struct mutex update_lock;
1242 char valid; /* !=0 if following fields are valid */
1243 unsigned long last_updated; /* In jiffies */
1244 @@ -497,9 +497,9 @@ static int lm80_detect(struct i2c_adapter *adapter, int address, int kind)
1245 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm80_group)))
1246 goto error_detach;
1248 - data->class_dev = hwmon_device_register(&new_client->dev);
1249 - if (IS_ERR(data->class_dev)) {
1250 - err = PTR_ERR(data->class_dev);
1251 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1252 + if (IS_ERR(data->hwmon_dev)) {
1253 + err = PTR_ERR(data->hwmon_dev);
1254 goto error_remove;
1257 @@ -520,7 +520,7 @@ static int lm80_detach_client(struct i2c_client *client)
1258 struct lm80_data *data = i2c_get_clientdata(client);
1259 int err;
1261 - hwmon_device_unregister(data->class_dev);
1262 + hwmon_device_unregister(data->hwmon_dev);
1263 sysfs_remove_group(&client->dev.kobj, &lm80_group);
1264 if ((err = i2c_detach_client(client)))
1265 return err;
1266 diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c
1267 index 654c0f7..0336b45 100644
1268 --- a/drivers/hwmon/lm83.c
1269 +++ b/drivers/hwmon/lm83.c
1270 @@ -144,7 +144,7 @@ static struct i2c_driver lm83_driver = {
1272 struct lm83_data {
1273 struct i2c_client client;
1274 - struct class_device *class_dev;
1275 + struct device *hwmon_dev;
1276 struct mutex update_lock;
1277 char valid; /* zero until following fields are valid */
1278 unsigned long last_updated; /* in jiffies */
1279 @@ -400,9 +400,9 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, int kind)
1280 goto exit_remove_files;
1283 - data->class_dev = hwmon_device_register(&new_client->dev);
1284 - if (IS_ERR(data->class_dev)) {
1285 - err = PTR_ERR(data->class_dev);
1286 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1287 + if (IS_ERR(data->hwmon_dev)) {
1288 + err = PTR_ERR(data->hwmon_dev);
1289 goto exit_remove_files;
1292 @@ -424,7 +424,7 @@ static int lm83_detach_client(struct i2c_client *client)
1293 struct lm83_data *data = i2c_get_clientdata(client);
1294 int err;
1296 - hwmon_device_unregister(data->class_dev);
1297 + hwmon_device_unregister(data->hwmon_dev);
1298 sysfs_remove_group(&client->dev.kobj, &lm83_group);
1299 sysfs_remove_group(&client->dev.kobj, &lm83_group_opt);
1301 diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
1302 index 20a8c64..954c364 100644
1303 --- a/drivers/hwmon/lm85.c
1304 +++ b/drivers/hwmon/lm85.c
1305 @@ -328,7 +328,7 @@ struct lm85_autofan {
1306 The structure is dynamically allocated. */
1307 struct lm85_data {
1308 struct i2c_client client;
1309 - struct class_device *class_dev;
1310 + struct device *hwmon_dev;
1311 enum chips type;
1313 struct mutex update_lock;
1314 @@ -1257,9 +1257,9 @@ static int lm85_detect(struct i2c_adapter *adapter, int address,
1315 &dev_attr_in4_max)))
1316 goto ERROR3;
1318 - data->class_dev = hwmon_device_register(&new_client->dev);
1319 - if (IS_ERR(data->class_dev)) {
1320 - err = PTR_ERR(data->class_dev);
1321 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1322 + if (IS_ERR(data->hwmon_dev)) {
1323 + err = PTR_ERR(data->hwmon_dev);
1324 goto ERROR3;
1327 @@ -1280,7 +1280,7 @@ static int lm85_detect(struct i2c_adapter *adapter, int address,
1328 static int lm85_detach_client(struct i2c_client *client)
1330 struct lm85_data *data = i2c_get_clientdata(client);
1331 - hwmon_device_unregister(data->class_dev);
1332 + hwmon_device_unregister(data->hwmon_dev);
1333 sysfs_remove_group(&client->dev.kobj, &lm85_group);
1334 sysfs_remove_group(&client->dev.kobj, &lm85_group_opt);
1335 i2c_detach_client(client);
1336 diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
1337 index 988ae1c..e60076e 100644
1338 --- a/drivers/hwmon/lm87.c
1339 +++ b/drivers/hwmon/lm87.c
1340 @@ -176,7 +176,7 @@ static struct i2c_driver lm87_driver = {
1342 struct lm87_data {
1343 struct i2c_client client;
1344 - struct class_device *class_dev;
1345 + struct device *hwmon_dev;
1346 struct mutex update_lock;
1347 char valid; /* zero until following fields are valid */
1348 unsigned long last_updated; /* In jiffies */
1349 @@ -755,9 +755,9 @@ static int lm87_detect(struct i2c_adapter *adapter, int address, int kind)
1350 goto exit_remove;
1353 - data->class_dev = hwmon_device_register(&new_client->dev);
1354 - if (IS_ERR(data->class_dev)) {
1355 - err = PTR_ERR(data->class_dev);
1356 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1357 + if (IS_ERR(data->hwmon_dev)) {
1358 + err = PTR_ERR(data->hwmon_dev);
1359 goto exit_remove;
1362 @@ -816,7 +816,7 @@ static int lm87_detach_client(struct i2c_client *client)
1363 struct lm87_data *data = i2c_get_clientdata(client);
1364 int err;
1366 - hwmon_device_unregister(data->class_dev);
1367 + hwmon_device_unregister(data->hwmon_dev);
1368 sysfs_remove_group(&client->dev.kobj, &lm87_group);
1369 sysfs_remove_group(&client->dev.kobj, &lm87_group_opt);
1371 diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
1372 index af541d6..98b53b1 100644
1373 --- a/drivers/hwmon/lm90.c
1374 +++ b/drivers/hwmon/lm90.c
1375 @@ -214,7 +214,7 @@ static struct i2c_driver lm90_driver = {
1377 struct lm90_data {
1378 struct i2c_client client;
1379 - struct class_device *class_dev;
1380 + struct device *hwmon_dev;
1381 struct mutex update_lock;
1382 char valid; /* zero until following fields are valid */
1383 unsigned long last_updated; /* in jiffies */
1384 @@ -653,9 +653,9 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
1385 goto exit_remove_files;
1388 - data->class_dev = hwmon_device_register(&new_client->dev);
1389 - if (IS_ERR(data->class_dev)) {
1390 - err = PTR_ERR(data->class_dev);
1391 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1392 + if (IS_ERR(data->hwmon_dev)) {
1393 + err = PTR_ERR(data->hwmon_dev);
1394 goto exit_remove_files;
1397 @@ -707,7 +707,7 @@ static int lm90_detach_client(struct i2c_client *client)
1398 struct lm90_data *data = i2c_get_clientdata(client);
1399 int err;
1401 - hwmon_device_unregister(data->class_dev);
1402 + hwmon_device_unregister(data->hwmon_dev);
1403 sysfs_remove_group(&client->dev.kobj, &lm90_group);
1404 device_remove_file(&client->dev, &dev_attr_pec);
1406 diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c
1407 index 30b5363..61d1bd1 100644
1408 --- a/drivers/hwmon/lm92.c
1409 +++ b/drivers/hwmon/lm92.c
1410 @@ -96,7 +96,7 @@ static struct i2c_driver lm92_driver;
1411 /* Client data (each client gets its own) */
1412 struct lm92_data {
1413 struct i2c_client client;
1414 - struct class_device *class_dev;
1415 + struct device *hwmon_dev;
1416 struct mutex update_lock;
1417 char valid; /* zero until following fields are valid */
1418 unsigned long last_updated; /* in jiffies */
1419 @@ -379,9 +379,9 @@ static int lm92_detect(struct i2c_adapter *adapter, int address, int kind)
1420 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm92_group)))
1421 goto exit_detach;
1423 - data->class_dev = hwmon_device_register(&new_client->dev);
1424 - if (IS_ERR(data->class_dev)) {
1425 - err = PTR_ERR(data->class_dev);
1426 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1427 + if (IS_ERR(data->hwmon_dev)) {
1428 + err = PTR_ERR(data->hwmon_dev);
1429 goto exit_remove;
1432 @@ -409,7 +409,7 @@ static int lm92_detach_client(struct i2c_client *client)
1433 struct lm92_data *data = i2c_get_clientdata(client);
1434 int err;
1436 - hwmon_device_unregister(data->class_dev);
1437 + hwmon_device_unregister(data->hwmon_dev);
1438 sysfs_remove_group(&client->dev.kobj, &lm92_group);
1440 if ((err = i2c_detach_client(client)))
1441 diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c
1442 index 86c6c6e..b9899b9 100644
1443 --- a/drivers/hwmon/lm93.c
1444 +++ b/drivers/hwmon/lm93.c
1445 @@ -201,7 +201,7 @@ struct block1_t {
1447 struct lm93_data {
1448 struct i2c_client client;
1449 - struct class_device *class_dev;
1450 + struct device *hwmon_dev;
1452 struct mutex update_lock;
1453 unsigned long last_updated; /* In jiffies */
1454 @@ -2590,11 +2590,11 @@ static int lm93_detect(struct i2c_adapter *adapter, int address, int kind)
1455 goto err_detach;
1457 /* Register hwmon driver class */
1458 - data->class_dev = hwmon_device_register(&client->dev);
1459 - if ( !IS_ERR(data->class_dev))
1460 + data->hwmon_dev = hwmon_device_register(&client->dev);
1461 + if ( !IS_ERR(data->hwmon_dev))
1462 return 0;
1464 - err = PTR_ERR(data->class_dev);
1465 + err = PTR_ERR(data->hwmon_dev);
1466 dev_err(&client->dev, "error registering hwmon device.\n");
1467 sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp);
1468 err_detach:
1469 @@ -2619,7 +2619,7 @@ static int lm93_detach_client(struct i2c_client *client)
1470 struct lm93_data *data = i2c_get_clientdata(client);
1471 int err = 0;
1473 - hwmon_device_unregister(data->class_dev);
1474 + hwmon_device_unregister(data->hwmon_dev);
1475 sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp);
1477 err = i2c_detach_client(client);
1478 diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c
1479 index 2f58f65..38a44c3 100644
1480 --- a/drivers/hwmon/max1619.c
1481 +++ b/drivers/hwmon/max1619.c
1482 @@ -105,7 +105,7 @@ static struct i2c_driver max1619_driver = {
1484 struct max1619_data {
1485 struct i2c_client client;
1486 - struct class_device *class_dev;
1487 + struct device *hwmon_dev;
1488 struct mutex update_lock;
1489 char valid; /* zero until following fields are valid */
1490 unsigned long last_updated; /* in jiffies */
1491 @@ -293,9 +293,9 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind)
1492 if ((err = sysfs_create_group(&new_client->dev.kobj, &max1619_group)))
1493 goto exit_detach;
1495 - data->class_dev = hwmon_device_register(&new_client->dev);
1496 - if (IS_ERR(data->class_dev)) {
1497 - err = PTR_ERR(data->class_dev);
1498 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
1499 + if (IS_ERR(data->hwmon_dev)) {
1500 + err = PTR_ERR(data->hwmon_dev);
1501 goto exit_remove_files;
1504 @@ -331,7 +331,7 @@ static int max1619_detach_client(struct i2c_client *client)
1505 struct max1619_data *data = i2c_get_clientdata(client);
1506 int err;
1508 - hwmon_device_unregister(data->class_dev);
1509 + hwmon_device_unregister(data->hwmon_dev);
1510 sysfs_remove_group(&client->dev.kobj, &max1619_group);
1512 if ((err = i2c_detach_client(client)))
1513 diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
1514 index 8415664..755570c 100644
1515 --- a/drivers/hwmon/max6650.c
1516 +++ b/drivers/hwmon/max6650.c
1517 @@ -128,7 +128,7 @@ static struct i2c_driver max6650_driver = {
1518 struct max6650_data
1520 struct i2c_client client;
1521 - struct class_device *class_dev;
1522 + struct device *hwmon_dev;
1523 struct mutex update_lock;
1524 char valid; /* zero until following fields are valid */
1525 unsigned long last_updated; /* in jiffies */
1526 @@ -523,11 +523,11 @@ static int max6650_detect(struct i2c_adapter *adapter, int address, int kind)
1527 if (err)
1528 goto err_detach;
1530 - data->class_dev = hwmon_device_register(&client->dev);
1531 - if (!IS_ERR(data->class_dev))
1532 + data->hwmon_dev = hwmon_device_register(&client->dev);
1533 + if (!IS_ERR(data->hwmon_dev))
1534 return 0;
1536 - err = PTR_ERR(data->class_dev);
1537 + err = PTR_ERR(data->hwmon_dev);
1538 dev_err(&client->dev, "error registering hwmon device.\n");
1539 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp);
1540 err_detach:
1541 @@ -543,7 +543,7 @@ static int max6650_detach_client(struct i2c_client *client)
1542 int err;
1544 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp);
1545 - hwmon_device_unregister(data->class_dev);
1546 + hwmon_device_unregister(data->hwmon_dev);
1547 err = i2c_detach_client(client);
1548 if (!err)
1549 kfree(data);
1550 diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
1551 index f57c75d..91cf510 100644
1552 --- a/drivers/hwmon/pc87360.c
1553 +++ b/drivers/hwmon/pc87360.c
1554 @@ -180,7 +180,7 @@ static inline u8 PWM_TO_REG(int val, int inv)
1556 struct pc87360_data {
1557 const char *name;
1558 - struct class_device *class_dev;
1559 + struct device *hwmon_dev;
1560 struct mutex lock;
1561 struct mutex update_lock;
1562 char valid; /* !=0 if following fields are valid */
1563 @@ -1054,9 +1054,9 @@ static int __devinit pc87360_probe(struct platform_device *pdev)
1564 if ((err = device_create_file(dev, &dev_attr_name)))
1565 goto ERROR3;
1567 - data->class_dev = hwmon_device_register(dev);
1568 - if (IS_ERR(data->class_dev)) {
1569 - err = PTR_ERR(data->class_dev);
1570 + data->hwmon_dev = hwmon_device_register(dev);
1571 + if (IS_ERR(data->hwmon_dev)) {
1572 + err = PTR_ERR(data->hwmon_dev);
1573 goto ERROR3;
1575 return 0;
1576 @@ -1083,7 +1083,7 @@ static int __devexit pc87360_remove(struct platform_device *pdev)
1577 struct pc87360_data *data = platform_get_drvdata(pdev);
1578 int i;
1580 - hwmon_device_unregister(data->class_dev);
1581 + hwmon_device_unregister(data->hwmon_dev);
1583 device_remove_file(&pdev->dev, &dev_attr_name);
1584 sysfs_remove_group(&pdev->dev.kobj, &pc8736x_temp_group);
1585 diff --git a/drivers/hwmon/pc87427.c b/drivers/hwmon/pc87427.c
1586 index 2915bc4..d40509a 100644
1587 --- a/drivers/hwmon/pc87427.c
1588 +++ b/drivers/hwmon/pc87427.c
1589 @@ -42,7 +42,7 @@ static struct platform_device *pdev;
1590 device is using banked registers) and the register cache (needed to keep
1591 the data in the registers and the cache in sync at any time). */
1592 struct pc87427_data {
1593 - struct class_device *class_dev;
1594 + struct device *hwmon_dev;
1595 struct mutex lock;
1596 int address[2];
1597 const char *name;
1598 @@ -454,9 +454,9 @@ static int __devinit pc87427_probe(struct platform_device *pdev)
1599 goto exit_remove_files;
1602 - data->class_dev = hwmon_device_register(&pdev->dev);
1603 - if (IS_ERR(data->class_dev)) {
1604 - err = PTR_ERR(data->class_dev);
1605 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
1606 + if (IS_ERR(data->hwmon_dev)) {
1607 + err = PTR_ERR(data->hwmon_dev);
1608 dev_err(&pdev->dev, "Class registration failed (%d)\n", err);
1609 goto exit_remove_files;
1611 @@ -484,7 +484,7 @@ static int __devexit pc87427_remove(struct platform_device *pdev)
1612 struct resource *res;
1613 int i;
1615 - hwmon_device_unregister(data->class_dev);
1616 + hwmon_device_unregister(data->hwmon_dev);
1617 device_remove_file(&pdev->dev, &dev_attr_name);
1618 for (i = 0; i < 8; i++) {
1619 if (!(data->fan_enabled & (1 << i)))
1620 diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c
1621 index 92956eb..3de9721 100644
1622 --- a/drivers/hwmon/sis5595.c
1623 +++ b/drivers/hwmon/sis5595.c
1624 @@ -163,7 +163,7 @@ static inline u8 DIV_TO_REG(int val)
1625 struct sis5595_data {
1626 unsigned short addr;
1627 const char *name;
1628 - struct class_device *class_dev;
1629 + struct device *hwmon_dev;
1630 struct mutex lock;
1632 struct mutex update_lock;
1633 @@ -557,9 +557,9 @@ static int __devinit sis5595_probe(struct platform_device *pdev)
1634 goto exit_remove_files;
1637 - data->class_dev = hwmon_device_register(&pdev->dev);
1638 - if (IS_ERR(data->class_dev)) {
1639 - err = PTR_ERR(data->class_dev);
1640 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
1641 + if (IS_ERR(data->hwmon_dev)) {
1642 + err = PTR_ERR(data->hwmon_dev);
1643 goto exit_remove_files;
1646 @@ -580,7 +580,7 @@ static int __devexit sis5595_remove(struct platform_device *pdev)
1648 struct sis5595_data *data = platform_get_drvdata(pdev);
1650 - hwmon_device_unregister(data->class_dev);
1651 + hwmon_device_unregister(data->hwmon_dev);
1652 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group);
1653 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt);
1655 diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c
1656 index 45266b3..0b57d2e 100644
1657 --- a/drivers/hwmon/smsc47b397.c
1658 +++ b/drivers/hwmon/smsc47b397.c
1659 @@ -94,7 +94,7 @@ static u8 smsc47b397_reg_temp[] = {0x25, 0x26, 0x27, 0x80};
1660 struct smsc47b397_data {
1661 unsigned short addr;
1662 const char *name;
1663 - struct class_device *class_dev;
1664 + struct device *hwmon_dev;
1665 struct mutex lock;
1667 struct mutex update_lock;
1668 @@ -222,7 +222,7 @@ static int __devexit smsc47b397_remove(struct platform_device *pdev)
1669 struct smsc47b397_data *data = platform_get_drvdata(pdev);
1670 struct resource *res;
1672 - hwmon_device_unregister(data->class_dev);
1673 + hwmon_device_unregister(data->hwmon_dev);
1674 sysfs_remove_group(&pdev->dev.kobj, &smsc47b397_group);
1675 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
1676 release_region(res->start, SMSC_EXTENT);
1677 @@ -272,9 +272,9 @@ static int __devinit smsc47b397_probe(struct platform_device *pdev)
1678 if ((err = sysfs_create_group(&dev->kobj, &smsc47b397_group)))
1679 goto error_free;
1681 - data->class_dev = hwmon_device_register(dev);
1682 - if (IS_ERR(data->class_dev)) {
1683 - err = PTR_ERR(data->class_dev);
1684 + data->hwmon_dev = hwmon_device_register(dev);
1685 + if (IS_ERR(data->hwmon_dev)) {
1686 + err = PTR_ERR(data->hwmon_dev);
1687 goto error_remove;
1690 diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
1691 index 7179277..a10a380 100644
1692 --- a/drivers/hwmon/smsc47m1.c
1693 +++ b/drivers/hwmon/smsc47m1.c
1694 @@ -116,7 +116,7 @@ struct smsc47m1_data {
1695 unsigned short addr;
1696 const char *name;
1697 enum chips type;
1698 - struct class_device *class_dev;
1699 + struct device *hwmon_dev;
1701 struct mutex update_lock;
1702 unsigned long last_updated; /* In jiffies */
1703 @@ -588,9 +588,9 @@ static int __devinit smsc47m1_probe(struct platform_device *pdev)
1704 if ((err = device_create_file(dev, &dev_attr_name)))
1705 goto error_remove_files;
1707 - data->class_dev = hwmon_device_register(dev);
1708 - if (IS_ERR(data->class_dev)) {
1709 - err = PTR_ERR(data->class_dev);
1710 + data->hwmon_dev = hwmon_device_register(dev);
1711 + if (IS_ERR(data->hwmon_dev)) {
1712 + err = PTR_ERR(data->hwmon_dev);
1713 goto error_remove_files;
1716 @@ -611,7 +611,7 @@ static int __devexit smsc47m1_remove(struct platform_device *pdev)
1717 struct smsc47m1_data *data = platform_get_drvdata(pdev);
1718 struct resource *res;
1720 - hwmon_device_unregister(data->class_dev);
1721 + hwmon_device_unregister(data->hwmon_dev);
1722 sysfs_remove_group(&pdev->dev.kobj, &smsc47m1_group);
1724 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
1725 diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c
1726 index d3a3ba0..0efcd27 100644
1727 --- a/drivers/hwmon/smsc47m192.c
1728 +++ b/drivers/hwmon/smsc47m192.c
1729 @@ -97,7 +97,7 @@ static inline int TEMP_FROM_REG(s8 val)
1731 struct smsc47m192_data {
1732 struct i2c_client client;
1733 - struct class_device *class_dev;
1734 + struct device *hwmon_dev;
1735 struct mutex update_lock;
1736 char valid; /* !=0 if following fields are valid */
1737 unsigned long last_updated; /* In jiffies */
1738 @@ -553,9 +553,9 @@ static int smsc47m192_detect(struct i2c_adapter *adapter, int address,
1739 goto exit_remove_files;
1742 - data->class_dev = hwmon_device_register(&client->dev);
1743 - if (IS_ERR(data->class_dev)) {
1744 - err = PTR_ERR(data->class_dev);
1745 + data->hwmon_dev = hwmon_device_register(&client->dev);
1746 + if (IS_ERR(data->hwmon_dev)) {
1747 + err = PTR_ERR(data->hwmon_dev);
1748 goto exit_remove_files;
1751 @@ -577,7 +577,7 @@ static int smsc47m192_detach_client(struct i2c_client *client)
1752 struct smsc47m192_data *data = i2c_get_clientdata(client);
1753 int err;
1755 - hwmon_device_unregister(data->class_dev);
1756 + hwmon_device_unregister(data->hwmon_dev);
1757 sysfs_remove_group(&client->dev.kobj, &smsc47m192_group);
1758 sysfs_remove_group(&client->dev.kobj, &smsc47m192_group_in4);
1760 diff --git a/drivers/hwmon/thmc50.c b/drivers/hwmon/thmc50.c
1761 index c920f39..981d1f1 100644
1762 --- a/drivers/hwmon/thmc50.c
1763 +++ b/drivers/hwmon/thmc50.c
1764 @@ -61,7 +61,7 @@ const static u8 THMC50_REG_TEMP_MAX[] = { 0x39, 0x37, 0x2B };
1765 /* Each client has this additional data */
1766 struct thmc50_data {
1767 struct i2c_client client;
1768 - struct class_device *class_dev;
1769 + struct device *hwmon_dev;
1771 struct mutex update_lock;
1772 enum chips type;
1773 @@ -351,9 +351,9 @@ static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind)
1774 goto exit_remove_sysfs_thmc50;
1776 /* Register a new directory entry with module sensors */
1777 - data->class_dev = hwmon_device_register(&client->dev);
1778 - if (IS_ERR(data->class_dev)) {
1779 - err = PTR_ERR(data->class_dev);
1780 + data->hwmon_dev = hwmon_device_register(&client->dev);
1781 + if (IS_ERR(data->hwmon_dev)) {
1782 + err = PTR_ERR(data->hwmon_dev);
1783 goto exit_remove_sysfs;
1786 @@ -384,7 +384,7 @@ static int thmc50_detach_client(struct i2c_client *client)
1787 struct thmc50_data *data = i2c_get_clientdata(client);
1788 int err;
1790 - hwmon_device_unregister(data->class_dev);
1791 + hwmon_device_unregister(data->hwmon_dev);
1792 sysfs_remove_group(&client->dev.kobj, &thmc50_group);
1793 if (data->type == adm1022)
1794 sysfs_remove_group(&client->dev.kobj, &adm1022_group);
1795 diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c
1796 index 696c8a2..8f63dad 100644
1797 --- a/drivers/hwmon/via686a.c
1798 +++ b/drivers/hwmon/via686a.c
1799 @@ -294,7 +294,7 @@ static inline long TEMP_FROM_REG10(u16 val)
1800 struct via686a_data {
1801 unsigned short addr;
1802 const char *name;
1803 - struct class_device *class_dev;
1804 + struct device *hwmon_dev;
1805 struct mutex update_lock;
1806 char valid; /* !=0 if following fields are valid */
1807 unsigned long last_updated; /* In jiffies */
1808 @@ -627,9 +627,9 @@ static int __devinit via686a_probe(struct platform_device *pdev)
1809 if ((err = sysfs_create_group(&pdev->dev.kobj, &via686a_group)))
1810 goto exit_free;
1812 - data->class_dev = hwmon_device_register(&pdev->dev);
1813 - if (IS_ERR(data->class_dev)) {
1814 - err = PTR_ERR(data->class_dev);
1815 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
1816 + if (IS_ERR(data->hwmon_dev)) {
1817 + err = PTR_ERR(data->hwmon_dev);
1818 goto exit_remove_files;
1821 @@ -648,7 +648,7 @@ static int __devexit via686a_remove(struct platform_device *pdev)
1823 struct via686a_data *data = platform_get_drvdata(pdev);
1825 - hwmon_device_unregister(data->class_dev);
1826 + hwmon_device_unregister(data->hwmon_dev);
1827 sysfs_remove_group(&pdev->dev.kobj, &via686a_group);
1829 release_region(data->addr, VIA686A_EXTENT);
1830 diff --git a/drivers/hwmon/vt1211.c b/drivers/hwmon/vt1211.c
1831 index 9f3e332..e694164 100644
1832 --- a/drivers/hwmon/vt1211.c
1833 +++ b/drivers/hwmon/vt1211.c
1834 @@ -108,7 +108,7 @@ static const u8 bitalarmfan[] = {6, 7};
1835 struct vt1211_data {
1836 unsigned short addr;
1837 const char *name;
1838 - struct class_device *class_dev;
1839 + struct device *hwmon_dev;
1841 struct mutex update_lock;
1842 char valid; /* !=0 if following fields are valid */
1843 @@ -1191,9 +1191,9 @@ static int __devinit vt1211_probe(struct platform_device *pdev)
1846 /* Register device */
1847 - data->class_dev = hwmon_device_register(dev);
1848 - if (IS_ERR(data->class_dev)) {
1849 - err = PTR_ERR(data->class_dev);
1850 + data->hwmon_dev = hwmon_device_register(dev);
1851 + if (IS_ERR(data->hwmon_dev)) {
1852 + err = PTR_ERR(data->hwmon_dev);
1853 dev_err(dev, "Class registration failed (%d)\n", err);
1854 goto EXIT_DEV_REMOVE_SILENT;
1856 @@ -1217,7 +1217,7 @@ static int __devexit vt1211_remove(struct platform_device *pdev)
1857 struct vt1211_data *data = platform_get_drvdata(pdev);
1858 struct resource *res;
1860 - hwmon_device_unregister(data->class_dev);
1861 + hwmon_device_unregister(data->hwmon_dev);
1862 vt1211_remove_sysfs(pdev);
1863 platform_set_drvdata(pdev, NULL);
1864 kfree(data);
1865 diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c
1866 index 3e63eaf..8806302 100644
1867 --- a/drivers/hwmon/vt8231.c
1868 +++ b/drivers/hwmon/vt8231.c
1869 @@ -148,7 +148,7 @@ struct vt8231_data {
1870 const char *name;
1872 struct mutex update_lock;
1873 - struct class_device *class_dev;
1874 + struct device *hwmon_dev;
1875 char valid; /* !=0 if following fields are valid */
1876 unsigned long last_updated; /* In jiffies */
1878 @@ -726,9 +726,9 @@ int vt8231_probe(struct platform_device *pdev)
1882 - data->class_dev = hwmon_device_register(&pdev->dev);
1883 - if (IS_ERR(data->class_dev)) {
1884 - err = PTR_ERR(data->class_dev);
1885 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
1886 + if (IS_ERR(data->hwmon_dev)) {
1887 + err = PTR_ERR(data->hwmon_dev);
1888 goto exit_remove_files;
1890 return 0;
1891 @@ -756,7 +756,7 @@ static int __devexit vt8231_remove(struct platform_device *pdev)
1892 struct vt8231_data *data = platform_get_drvdata(pdev);
1893 int i;
1895 - hwmon_device_unregister(data->class_dev);
1896 + hwmon_device_unregister(data->hwmon_dev);
1898 for (i = 0; i < ARRAY_SIZE(vt8231_group_volts); i++)
1899 sysfs_remove_group(&pdev->dev.kobj, &vt8231_group_volts[i]);
1900 diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
1901 index e3dfc52..b15c6a9 100644
1902 --- a/drivers/hwmon/w83627ehf.c
1903 +++ b/drivers/hwmon/w83627ehf.c
1904 @@ -256,7 +256,7 @@ struct w83627ehf_data {
1905 int addr; /* IO base of hw monitor block */
1906 const char *name;
1908 - struct class_device *class_dev;
1909 + struct device *hwmon_dev;
1910 struct mutex lock;
1912 struct mutex update_lock;
1913 @@ -1384,9 +1384,9 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
1914 goto exit_remove;
1917 - data->class_dev = hwmon_device_register(dev);
1918 - if (IS_ERR(data->class_dev)) {
1919 - err = PTR_ERR(data->class_dev);
1920 + data->hwmon_dev = hwmon_device_register(dev);
1921 + if (IS_ERR(data->hwmon_dev)) {
1922 + err = PTR_ERR(data->hwmon_dev);
1923 goto exit_remove;
1926 @@ -1406,7 +1406,7 @@ static int __devexit w83627ehf_remove(struct platform_device *pdev)
1928 struct w83627ehf_data *data = platform_get_drvdata(pdev);
1930 - hwmon_device_unregister(data->class_dev);
1931 + hwmon_device_unregister(data->hwmon_dev);
1932 w83627ehf_device_remove_files(&pdev->dev);
1933 release_region(data->addr, IOREGION_LENGTH);
1934 platform_set_drvdata(pdev, NULL);
1935 diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
1936 index f0e0e20..b1943ec 100644
1937 --- a/drivers/hwmon/w83627hf.c
1938 +++ b/drivers/hwmon/w83627hf.c
1939 @@ -346,7 +346,7 @@ static inline u8 DIV_TO_REG(long val)
1940 struct w83627hf_data {
1941 unsigned short addr;
1942 const char *name;
1943 - struct class_device *class_dev;
1944 + struct device *hwmon_dev;
1945 struct mutex lock;
1946 enum chips type;
1948 @@ -1295,9 +1295,9 @@ static int __devinit w83627hf_probe(struct platform_device *pdev)
1949 || (err = device_create_file(dev, &dev_attr_pwm3_freq)))
1950 goto ERROR4;
1952 - data->class_dev = hwmon_device_register(dev);
1953 - if (IS_ERR(data->class_dev)) {
1954 - err = PTR_ERR(data->class_dev);
1955 + data->hwmon_dev = hwmon_device_register(dev);
1956 + if (IS_ERR(data->hwmon_dev)) {
1957 + err = PTR_ERR(data->hwmon_dev);
1958 goto ERROR4;
1961 @@ -1320,7 +1320,7 @@ static int __devexit w83627hf_remove(struct platform_device *pdev)
1962 struct w83627hf_data *data = platform_get_drvdata(pdev);
1963 struct resource *res;
1965 - hwmon_device_unregister(data->class_dev);
1966 + hwmon_device_unregister(data->hwmon_dev);
1968 sysfs_remove_group(&pdev->dev.kobj, &w83627hf_group);
1969 sysfs_remove_group(&pdev->dev.kobj, &w83627hf_group_opt);
1970 diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
1971 index c12bdf9..e622ec5 100644
1972 --- a/drivers/hwmon/w83781d.c
1973 +++ b/drivers/hwmon/w83781d.c
1974 @@ -220,7 +220,7 @@ DIV_TO_REG(long val, enum chips type)
1975 the driver field to differentiate between I2C and ISA chips. */
1976 struct w83781d_data {
1977 struct i2c_client client;
1978 - struct class_device *class_dev;
1979 + struct device *hwmon_dev;
1980 struct mutex lock;
1981 enum chips type;
1983 @@ -1158,9 +1158,9 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1984 if (err)
1985 goto ERROR4;
1987 - data->class_dev = hwmon_device_register(dev);
1988 - if (IS_ERR(data->class_dev)) {
1989 - err = PTR_ERR(data->class_dev);
1990 + data->hwmon_dev = hwmon_device_register(dev);
1991 + if (IS_ERR(data->hwmon_dev)) {
1992 + err = PTR_ERR(data->hwmon_dev);
1993 goto ERROR4;
1996 @@ -1194,7 +1194,7 @@ w83781d_detach_client(struct i2c_client *client)
1998 /* main client */
1999 if (data) {
2000 - hwmon_device_unregister(data->class_dev);
2001 + hwmon_device_unregister(data->hwmon_dev);
2002 sysfs_remove_group(&client->dev.kobj, &w83781d_group);
2003 sysfs_remove_group(&client->dev.kobj, &w83781d_group_opt);
2005 @@ -1261,9 +1261,9 @@ w83781d_isa_probe(struct platform_device *pdev)
2006 if (err)
2007 goto exit_remove_files;
2009 - data->class_dev = hwmon_device_register(&pdev->dev);
2010 - if (IS_ERR(data->class_dev)) {
2011 - err = PTR_ERR(data->class_dev);
2012 + data->hwmon_dev = hwmon_device_register(&pdev->dev);
2013 + if (IS_ERR(data->hwmon_dev)) {
2014 + err = PTR_ERR(data->hwmon_dev);
2015 goto exit_remove_files;
2018 @@ -1285,7 +1285,7 @@ w83781d_isa_remove(struct platform_device *pdev)
2020 struct w83781d_data *data = platform_get_drvdata(pdev);
2022 - hwmon_device_unregister(data->class_dev);
2023 + hwmon_device_unregister(data->hwmon_dev);
2024 sysfs_remove_group(&pdev->dev.kobj, &w83781d_group);
2025 sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt);
2026 device_remove_file(&pdev->dev, &dev_attr_name);
2027 diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c
2028 index 9e5f885..a3cb894 100644
2029 --- a/drivers/hwmon/w83791d.c
2030 +++ b/drivers/hwmon/w83791d.c
2031 @@ -247,7 +247,7 @@ static u8 div_to_reg(int nr, long val)
2033 struct w83791d_data {
2034 struct i2c_client client;
2035 - struct class_device *class_dev;
2036 + struct device *hwmon_dev;
2037 struct mutex update_lock;
2039 char valid; /* !=0 if following fields are valid */
2040 @@ -1017,9 +1017,9 @@ static int w83791d_detect(struct i2c_adapter *adapter, int address, int kind)
2041 goto error3;
2043 /* Everything is ready, now register the working device */
2044 - data->class_dev = hwmon_device_register(dev);
2045 - if (IS_ERR(data->class_dev)) {
2046 - err = PTR_ERR(data->class_dev);
2047 + data->hwmon_dev = hwmon_device_register(dev);
2048 + if (IS_ERR(data->hwmon_dev)) {
2049 + err = PTR_ERR(data->hwmon_dev);
2050 goto error4;
2053 @@ -1051,7 +1051,7 @@ static int w83791d_detach_client(struct i2c_client *client)
2055 /* main client */
2056 if (data) {
2057 - hwmon_device_unregister(data->class_dev);
2058 + hwmon_device_unregister(data->hwmon_dev);
2059 sysfs_remove_group(&client->dev.kobj, &w83791d_group);
2062 diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
2063 index f6dee38..f836198 100644
2064 --- a/drivers/hwmon/w83792d.c
2065 +++ b/drivers/hwmon/w83792d.c
2066 @@ -267,7 +267,7 @@ DIV_TO_REG(long val)
2068 struct w83792d_data {
2069 struct i2c_client client;
2070 - struct class_device *class_dev;
2071 + struct device *hwmon_dev;
2072 enum chips type;
2074 struct mutex update_lock;
2075 @@ -1443,9 +1443,9 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
2076 &w83792d_group_fan[3])))
2077 goto exit_remove_files;
2079 - data->class_dev = hwmon_device_register(dev);
2080 - if (IS_ERR(data->class_dev)) {
2081 - err = PTR_ERR(data->class_dev);
2082 + data->hwmon_dev = hwmon_device_register(dev);
2083 + if (IS_ERR(data->hwmon_dev)) {
2084 + err = PTR_ERR(data->hwmon_dev);
2085 goto exit_remove_files;
2088 @@ -1480,7 +1480,7 @@ w83792d_detach_client(struct i2c_client *client)
2090 /* main client */
2091 if (data) {
2092 - hwmon_device_unregister(data->class_dev);
2093 + hwmon_device_unregister(data->hwmon_dev);
2094 sysfs_remove_group(&client->dev.kobj, &w83792d_group);
2095 for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++)
2096 sysfs_remove_group(&client->dev.kobj,
2097 diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
2098 index 253ffaf..48599e1 100644
2099 --- a/drivers/hwmon/w83793.c
2100 +++ b/drivers/hwmon/w83793.c
2101 @@ -179,7 +179,7 @@ static inline s8 TEMP_TO_REG(long val, s8 min, s8 max)
2102 struct w83793_data {
2103 struct i2c_client client;
2104 struct i2c_client *lm75[2];
2105 - struct class_device *class_dev;
2106 + struct device *hwmon_dev;
2107 struct mutex update_lock;
2108 char valid; /* !=0 if following fields are valid */
2109 unsigned long last_updated; /* In jiffies */
2110 @@ -1075,7 +1075,7 @@ static int w83793_detach_client(struct i2c_client *client)
2112 /* main client */
2113 if (data) {
2114 - hwmon_device_unregister(data->class_dev);
2115 + hwmon_device_unregister(data->hwmon_dev);
2117 for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++)
2118 device_remove_file(dev,
2119 @@ -1434,9 +1434,9 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind)
2123 - data->class_dev = hwmon_device_register(dev);
2124 - if (IS_ERR(data->class_dev)) {
2125 - err = PTR_ERR(data->class_dev);
2126 + data->hwmon_dev = hwmon_device_register(dev);
2127 + if (IS_ERR(data->hwmon_dev)) {
2128 + err = PTR_ERR(data->hwmon_dev);
2129 goto exit_remove;
2132 diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c
2133 index a3fcace..b5db354 100644
2134 --- a/drivers/hwmon/w83l785ts.c
2135 +++ b/drivers/hwmon/w83l785ts.c
2136 @@ -107,7 +107,7 @@ static struct i2c_driver w83l785ts_driver = {
2138 struct w83l785ts_data {
2139 struct i2c_client client;
2140 - struct class_device *class_dev;
2141 + struct device *hwmon_dev;
2142 struct mutex update_lock;
2143 char valid; /* zero until following fields are valid */
2144 unsigned long last_updated; /* in jiffies */
2145 @@ -247,9 +247,9 @@ static int w83l785ts_detect(struct i2c_adapter *adapter, int address, int kind)
2146 goto exit_remove;
2148 /* Register sysfs hooks */
2149 - data->class_dev = hwmon_device_register(&new_client->dev);
2150 - if (IS_ERR(data->class_dev)) {
2151 - err = PTR_ERR(data->class_dev);
2152 + data->hwmon_dev = hwmon_device_register(&new_client->dev);
2153 + if (IS_ERR(data->hwmon_dev)) {
2154 + err = PTR_ERR(data->hwmon_dev);
2155 goto exit_remove;
2158 @@ -272,7 +272,7 @@ static int w83l785ts_detach_client(struct i2c_client *client)
2159 struct w83l785ts_data *data = i2c_get_clientdata(client);
2160 int err;
2162 - hwmon_device_unregister(data->class_dev);
2163 + hwmon_device_unregister(data->hwmon_dev);
2164 device_remove_file(&client->dev,
2165 &sensor_dev_attr_temp1_input.dev_attr);
2166 device_remove_file(&client->dev,
2167 diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
2168 index 96581d0..51ae4fb 100644
2169 --- a/drivers/input/touchscreen/ads7846.c
2170 +++ b/drivers/input/touchscreen/ads7846.c
2171 @@ -83,7 +83,7 @@ struct ads7846 {
2173 #if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE)
2174 struct attribute_group *attr_group;
2175 - struct class_device *hwmon;
2176 + struct device *hwmon;
2177 #endif
2179 u16 model;
2180 @@ -369,7 +369,7 @@ static struct attribute_group ads7845_attr_group = {
2182 static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts)
2184 - struct class_device *hwmon;
2185 + struct device *hwmon;
2186 int err;
2188 /* hwmon sensors need a reference voltage */
2189 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
2190 index 0222bba..a717a25 100644
2191 --- a/drivers/misc/thinkpad_acpi.c
2192 +++ b/drivers/misc/thinkpad_acpi.c
2193 @@ -517,7 +517,7 @@ static char *next_cmd(char **cmds)
2194 ****************************************************************************/
2196 static struct platform_device *tpacpi_pdev;
2197 -static struct class_device *tpacpi_hwmon;
2198 +static struct device *tpacpi_hwmon;
2199 static struct input_dev *tpacpi_inputdev;
2202 diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
2203 index 082a1cb..acd5835 100644
2204 --- a/drivers/misc/thinkpad_acpi.h
2205 +++ b/drivers/misc/thinkpad_acpi.h
2206 @@ -171,7 +171,7 @@ static int parse_strtoul(const char *buf, unsigned long max,
2208 /* Device model */
2209 static struct platform_device *tpacpi_pdev;
2210 -static struct class_device *tpacpi_hwmon;
2211 +static struct device *tpacpi_hwmon;
2212 static struct platform_driver tpacpi_pdriver;
2213 static struct input_dev *tpacpi_inputdev;
2214 static int tpacpi_create_driver_attributes(struct device_driver *drv);
2215 diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
2216 index 0efd994..6b6ee70 100644
2217 --- a/include/linux/hwmon.h
2218 +++ b/include/linux/hwmon.h
2219 @@ -16,9 +16,9 @@
2221 #include <linux/device.h>
2223 -struct class_device *hwmon_device_register(struct device *dev);
2224 +struct device *hwmon_device_register(struct device *dev);
2226 -void hwmon_device_unregister(struct class_device *cdev);
2227 +void hwmon_device_unregister(struct device *dev);
2229 /* Scale user input to sensible values */
2230 static inline int SENSORS_LIMIT(long value, long low, long high)
2232 1.5.3.2