aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Jones <tonyj@suse.de>2007-08-20 16:46:20 -0400
committerMark M. Hoffman <mhoffman@lightlink.com>2007-10-09 22:56:30 -0400
commit1beeffe43311f64df8dd0ab08ff6b1858c58363f (patch)
tree039324186049a69f3c791165e90404aef497f3cc
parent59a35bafb223bbb0553ba1a3bb9280bda668a8d8 (diff)
hwmon: Convert from class_device to device
Convert from class_device to device for hwmon_device_register/unregister Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
-rw-r--r--drivers/hwmon/abituguru.c10
-rw-r--r--drivers/hwmon/abituguru3.c10
-rw-r--r--drivers/hwmon/ad7418.c10
-rw-r--r--drivers/hwmon/adm1021.c10
-rw-r--r--drivers/hwmon/adm1025.c10
-rw-r--r--drivers/hwmon/adm1026.c10
-rw-r--r--drivers/hwmon/adm1029.c10
-rw-r--r--drivers/hwmon/adm1031.c10
-rw-r--r--drivers/hwmon/adm9240.c10
-rw-r--r--drivers/hwmon/adt7470.c10
-rw-r--r--drivers/hwmon/applesmc.c10
-rw-r--r--drivers/hwmon/asb100.c10
-rw-r--r--drivers/hwmon/atxp1.c10
-rw-r--r--drivers/hwmon/coretemp.c10
-rw-r--r--drivers/hwmon/dme1737.c10
-rw-r--r--drivers/hwmon/ds1621.c10
-rw-r--r--drivers/hwmon/f71805f.c10
-rw-r--r--drivers/hwmon/f71882fg.c10
-rw-r--r--drivers/hwmon/f75375s.c10
-rw-r--r--drivers/hwmon/fscher.c10
-rw-r--r--drivers/hwmon/fscpos.c10
-rw-r--r--drivers/hwmon/gl518sm.c10
-rw-r--r--drivers/hwmon/gl520sm.c10
-rw-r--r--drivers/hwmon/hwmon.c27
-rw-r--r--drivers/hwmon/it87.c10
-rw-r--r--drivers/hwmon/k8temp.c10
-rw-r--r--drivers/hwmon/lm63.c10
-rw-r--r--drivers/hwmon/lm70.c12
-rw-r--r--drivers/hwmon/lm75.c10
-rw-r--r--drivers/hwmon/lm77.c10
-rw-r--r--drivers/hwmon/lm78.c18
-rw-r--r--drivers/hwmon/lm80.c10
-rw-r--r--drivers/hwmon/lm83.c10
-rw-r--r--drivers/hwmon/lm85.c10
-rw-r--r--drivers/hwmon/lm87.c10
-rw-r--r--drivers/hwmon/lm90.c10
-rw-r--r--drivers/hwmon/lm92.c10
-rw-r--r--drivers/hwmon/lm93.c10
-rw-r--r--drivers/hwmon/max1619.c10
-rw-r--r--drivers/hwmon/max6650.c10
-rw-r--r--drivers/hwmon/pc87360.c10
-rw-r--r--drivers/hwmon/pc87427.c10
-rw-r--r--drivers/hwmon/sis5595.c10
-rw-r--r--drivers/hwmon/smsc47b397.c10
-rw-r--r--drivers/hwmon/smsc47m1.c10
-rw-r--r--drivers/hwmon/smsc47m192.c10
-rw-r--r--drivers/hwmon/thmc50.c10
-rw-r--r--drivers/hwmon/via686a.c10
-rw-r--r--drivers/hwmon/vt1211.c10
-rw-r--r--drivers/hwmon/vt8231.c10
-rw-r--r--drivers/hwmon/w83627ehf.c10
-rw-r--r--drivers/hwmon/w83627hf.c10
-rw-r--r--drivers/hwmon/w83781d.c18
-rw-r--r--drivers/hwmon/w83791d.c10
-rw-r--r--drivers/hwmon/w83792d.c10
-rw-r--r--drivers/hwmon/w83793.c10
-rw-r--r--drivers/hwmon/w83l785ts.c10
-rw-r--r--drivers/input/touchscreen/ads7846.c4
-rw-r--r--drivers/misc/thinkpad_acpi.c2
-rw-r--r--drivers/misc/thinkpad_acpi.h2
-rw-r--r--include/linux/hwmon.h4
61 files changed, 308 insertions, 309 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index d575ee958de5..719151a92fec 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -176,7 +176,7 @@ MODULE_PARM_DESC(verbose, "How verbose should the driver be? (0-3):\n"
176 The structure is dynamically allocated, at the same time when a new 176 The structure is dynamically allocated, at the same time when a new
177 abituguru device is allocated. */ 177 abituguru device is allocated. */
178struct abituguru_data { 178struct abituguru_data {
179 struct class_device *class_dev; /* hwmon registered device */ 179 struct device *hwmon_dev; /* hwmon registered device */
180 struct mutex update_lock; /* protect access to data and uGuru */ 180 struct mutex update_lock; /* protect access to data and uGuru */
181 unsigned long last_updated; /* In jiffies */ 181 unsigned long last_updated; /* In jiffies */
182 unsigned short addr; /* uguru base address */ 182 unsigned short addr; /* uguru base address */
@@ -1287,11 +1287,11 @@ static int __devinit abituguru_probe(struct platform_device *pdev)
1287 &abituguru_sysfs_attr[i].dev_attr)) 1287 &abituguru_sysfs_attr[i].dev_attr))
1288 goto abituguru_probe_error; 1288 goto abituguru_probe_error;
1289 1289
1290 data->class_dev = hwmon_device_register(&pdev->dev); 1290 data->hwmon_dev = hwmon_device_register(&pdev->dev);
1291 if (!IS_ERR(data->class_dev)) 1291 if (!IS_ERR(data->hwmon_dev))
1292 return 0; /* success */ 1292 return 0; /* success */
1293 1293
1294 res = PTR_ERR(data->class_dev); 1294 res = PTR_ERR(data->hwmon_dev);
1295abituguru_probe_error: 1295abituguru_probe_error:
1296 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++) 1296 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++)
1297 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr); 1297 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr);
@@ -1308,7 +1308,7 @@ static int __devexit abituguru_remove(struct platform_device *pdev)
1308 int i; 1308 int i;
1309 struct abituguru_data *data = platform_get_drvdata(pdev); 1309 struct abituguru_data *data = platform_get_drvdata(pdev);
1310 1310
1311 hwmon_device_unregister(data->class_dev); 1311 hwmon_device_unregister(data->hwmon_dev);
1312 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++) 1312 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++)
1313 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr); 1313 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr);
1314 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) 1314 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++)
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
index cdd8b6dea16d..cb2331bfd9d5 100644
--- a/drivers/hwmon/abituguru3.c
+++ b/drivers/hwmon/abituguru3.c
@@ -124,7 +124,7 @@ struct abituguru3_motherboard_info {
124 The structure is dynamically allocated, at the same time when a new 124 The structure is dynamically allocated, at the same time when a new
125 abituguru3 device is allocated. */ 125 abituguru3 device is allocated. */
126struct abituguru3_data { 126struct abituguru3_data {
127 struct class_device *class_dev; /* hwmon registered device */ 127 struct device *hwmon_dev; /* hwmon registered device */
128 struct mutex update_lock; /* protect access to data and uGuru */ 128 struct mutex update_lock; /* protect access to data and uGuru */
129 unsigned short addr; /* uguru base address */ 129 unsigned short addr; /* uguru base address */
130 char valid; /* !=0 if following fields are valid */ 130 char valid; /* !=0 if following fields are valid */
@@ -933,9 +933,9 @@ static int __devinit abituguru3_probe(struct platform_device *pdev)
933 &abituguru3_sysfs_attr[i].dev_attr)) 933 &abituguru3_sysfs_attr[i].dev_attr))
934 goto abituguru3_probe_error; 934 goto abituguru3_probe_error;
935 935
936 data->class_dev = hwmon_device_register(&pdev->dev); 936 data->hwmon_dev = hwmon_device_register(&pdev->dev);
937 if (IS_ERR(data->class_dev)) { 937 if (IS_ERR(data->hwmon_dev)) {
938 res = PTR_ERR(data->class_dev); 938 res = PTR_ERR(data->hwmon_dev);
939 goto abituguru3_probe_error; 939 goto abituguru3_probe_error;
940 } 940 }
941 941
@@ -957,7 +957,7 @@ static int __devexit abituguru3_remove(struct platform_device *pdev)
957 struct abituguru3_data *data = platform_get_drvdata(pdev); 957 struct abituguru3_data *data = platform_get_drvdata(pdev);
958 958
959 platform_set_drvdata(pdev, NULL); 959 platform_set_drvdata(pdev, NULL);
960 hwmon_device_unregister(data->class_dev); 960 hwmon_device_unregister(data->hwmon_dev);
961 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++) 961 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++)
962 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr); 962 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr);
963 for (i = 0; i < ARRAY_SIZE(abituguru3_sysfs_attr); i++) 963 for (i = 0; i < ARRAY_SIZE(abituguru3_sysfs_attr); i++)
diff --git a/drivers/hwmon/ad7418.c b/drivers/hwmon/ad7418.c
index 879ea72ee3bd..fcd7fe78f3f9 100644
--- a/drivers/hwmon/ad7418.c
+++ b/drivers/hwmon/ad7418.c
@@ -47,7 +47,7 @@ static const u8 AD7418_REG_TEMP[] = { AD7418_REG_TEMP_IN,
47 47
48struct ad7418_data { 48struct ad7418_data {
49 struct i2c_client client; 49 struct i2c_client client;
50 struct class_device *class_dev; 50 struct device *hwmon_dev;
51 struct attribute_group attrs; 51 struct attribute_group attrs;
52 enum chips type; 52 enum chips type;
53 struct mutex lock; 53 struct mutex lock;
@@ -326,9 +326,9 @@ static int ad7418_detect(struct i2c_adapter *adapter, int address, int kind)
326 if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs))) 326 if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))
327 goto exit_detach; 327 goto exit_detach;
328 328
329 data->class_dev = hwmon_device_register(&client->dev); 329 data->hwmon_dev = hwmon_device_register(&client->dev);
330 if (IS_ERR(data->class_dev)) { 330 if (IS_ERR(data->hwmon_dev)) {
331 err = PTR_ERR(data->class_dev); 331 err = PTR_ERR(data->hwmon_dev);
332 goto exit_remove; 332 goto exit_remove;
333 } 333 }
334 334
@@ -347,7 +347,7 @@ exit:
347static int ad7418_detach_client(struct i2c_client *client) 347static int ad7418_detach_client(struct i2c_client *client)
348{ 348{
349 struct ad7418_data *data = i2c_get_clientdata(client); 349 struct ad7418_data *data = i2c_get_clientdata(client);
350 hwmon_device_unregister(data->class_dev); 350 hwmon_device_unregister(data->hwmon_dev);
351 sysfs_remove_group(&client->dev.kobj, &data->attrs); 351 sysfs_remove_group(&client->dev.kobj, &data->attrs);
352 i2c_detach_client(client); 352 i2c_detach_client(client);
353 kfree(data); 353 kfree(data);
diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
index 6649e0688361..5667630ac05a 100644
--- a/drivers/hwmon/adm1021.c
+++ b/drivers/hwmon/adm1021.c
@@ -91,7 +91,7 @@ clearing it. Weird, ey? --Phil */
91/* Each client has this additional data */ 91/* Each client has this additional data */
92struct adm1021_data { 92struct adm1021_data {
93 struct i2c_client client; 93 struct i2c_client client;
94 struct class_device *class_dev; 94 struct device *hwmon_dev;
95 enum chips type; 95 enum chips type;
96 96
97 struct mutex update_lock; 97 struct mutex update_lock;
@@ -319,9 +319,9 @@ static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind)
319 if ((err = sysfs_create_group(&client->dev.kobj, &adm1021_group))) 319 if ((err = sysfs_create_group(&client->dev.kobj, &adm1021_group)))
320 goto error2; 320 goto error2;
321 321
322 data->class_dev = hwmon_device_register(&client->dev); 322 data->hwmon_dev = hwmon_device_register(&client->dev);
323 if (IS_ERR(data->class_dev)) { 323 if (IS_ERR(data->hwmon_dev)) {
324 err = PTR_ERR(data->class_dev); 324 err = PTR_ERR(data->hwmon_dev);
325 goto error3; 325 goto error3;
326 } 326 }
327 327
@@ -351,7 +351,7 @@ static int adm1021_detach_client(struct i2c_client *client)
351 struct adm1021_data *data = i2c_get_clientdata(client); 351 struct adm1021_data *data = i2c_get_clientdata(client);
352 int err; 352 int err;
353 353
354 hwmon_device_unregister(data->class_dev); 354 hwmon_device_unregister(data->hwmon_dev);
355 sysfs_remove_group(&client->dev.kobj, &adm1021_group); 355 sysfs_remove_group(&client->dev.kobj, &adm1021_group);
356 356
357 if ((err = i2c_detach_client(client))) 357 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c
index 8c562885b54b..a67e133bfd3c 100644
--- a/drivers/hwmon/adm1025.c
+++ b/drivers/hwmon/adm1025.c
@@ -133,7 +133,7 @@ static struct i2c_driver adm1025_driver = {
133 133
134struct adm1025_data { 134struct adm1025_data {
135 struct i2c_client client; 135 struct i2c_client client;
136 struct class_device *class_dev; 136 struct device *hwmon_dev;
137 struct mutex update_lock; 137 struct mutex update_lock;
138 char valid; /* zero until following fields are valid */ 138 char valid; /* zero until following fields are valid */
139 unsigned long last_updated; /* in jiffies */ 139 unsigned long last_updated; /* in jiffies */
@@ -472,9 +472,9 @@ static int adm1025_detect(struct i2c_adapter *adapter, int address, int kind)
472 goto exit_remove; 472 goto exit_remove;
473 } 473 }
474 474
475 data->class_dev = hwmon_device_register(&new_client->dev); 475 data->hwmon_dev = hwmon_device_register(&new_client->dev);
476 if (IS_ERR(data->class_dev)) { 476 if (IS_ERR(data->hwmon_dev)) {
477 err = PTR_ERR(data->class_dev); 477 err = PTR_ERR(data->hwmon_dev);
478 goto exit_remove; 478 goto exit_remove;
479 } 479 }
480 480
@@ -538,7 +538,7 @@ static int adm1025_detach_client(struct i2c_client *client)
538 struct adm1025_data *data = i2c_get_clientdata(client); 538 struct adm1025_data *data = i2c_get_clientdata(client);
539 int err; 539 int err;
540 540
541 hwmon_device_unregister(data->class_dev); 541 hwmon_device_unregister(data->hwmon_dev);
542 sysfs_remove_group(&client->dev.kobj, &adm1025_group); 542 sysfs_remove_group(&client->dev.kobj, &adm1025_group);
543 sysfs_remove_group(&client->dev.kobj, &adm1025_group_opt); 543 sysfs_remove_group(&client->dev.kobj, &adm1025_group_opt);
544 544
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c
index ba80cd3258c6..b85370c7358b 100644
--- a/drivers/hwmon/adm1026.c
+++ b/drivers/hwmon/adm1026.c
@@ -260,7 +260,7 @@ struct pwm_data {
260 260
261struct adm1026_data { 261struct adm1026_data {
262 struct i2c_client client; 262 struct i2c_client client;
263 struct class_device *class_dev; 263 struct device *hwmon_dev;
264 enum chips type; 264 enum chips type;
265 265
266 struct mutex update_lock; 266 struct mutex update_lock;
@@ -1676,9 +1676,9 @@ static int adm1026_detect(struct i2c_adapter *adapter, int address,
1676 if ((err = sysfs_create_group(&new_client->dev.kobj, &adm1026_group))) 1676 if ((err = sysfs_create_group(&new_client->dev.kobj, &adm1026_group)))
1677 goto exitdetach; 1677 goto exitdetach;
1678 1678
1679 data->class_dev = hwmon_device_register(&new_client->dev); 1679 data->hwmon_dev = hwmon_device_register(&new_client->dev);
1680 if (IS_ERR(data->class_dev)) { 1680 if (IS_ERR(data->hwmon_dev)) {
1681 err = PTR_ERR(data->class_dev); 1681 err = PTR_ERR(data->hwmon_dev);
1682 goto exitremove; 1682 goto exitremove;
1683 } 1683 }
1684 1684
@@ -1698,7 +1698,7 @@ exit:
1698static int adm1026_detach_client(struct i2c_client *client) 1698static int adm1026_detach_client(struct i2c_client *client)
1699{ 1699{
1700 struct adm1026_data *data = i2c_get_clientdata(client); 1700 struct adm1026_data *data = i2c_get_clientdata(client);
1701 hwmon_device_unregister(data->class_dev); 1701 hwmon_device_unregister(data->hwmon_dev);
1702 sysfs_remove_group(&client->dev.kobj, &adm1026_group); 1702 sysfs_remove_group(&client->dev.kobj, &adm1026_group);
1703 i2c_detach_client(client); 1703 i2c_detach_client(client);
1704 kfree(data); 1704 kfree(data);
diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c
index 73ce31b31511..0bc897dffa27 100644
--- a/drivers/hwmon/adm1029.c
+++ b/drivers/hwmon/adm1029.c
@@ -141,7 +141,7 @@ static struct i2c_driver adm1029_driver = {
141 141
142struct adm1029_data { 142struct adm1029_data {
143 struct i2c_client client; 143 struct i2c_client client;
144 struct class_device *class_dev; 144 struct device *hwmon_dev;
145 struct mutex update_lock; 145 struct mutex update_lock;
146 char valid; /* zero until following fields are valid */ 146 char valid; /* zero until following fields are valid */
147 unsigned long last_updated; /* in jiffies */ 147 unsigned long last_updated; /* in jiffies */
@@ -391,9 +391,9 @@ static int adm1029_detect(struct i2c_adapter *adapter, int address, int kind)
391 if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group))) 391 if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group)))
392 goto exit_detach; 392 goto exit_detach;
393 393
394 data->class_dev = hwmon_device_register(&client->dev); 394 data->hwmon_dev = hwmon_device_register(&client->dev);
395 if (IS_ERR(data->class_dev)) { 395 if (IS_ERR(data->hwmon_dev)) {
396 err = PTR_ERR(data->class_dev); 396 err = PTR_ERR(data->hwmon_dev);
397 goto exit_remove_files; 397 goto exit_remove_files;
398 } 398 }
399 399
@@ -431,7 +431,7 @@ static int adm1029_detach_client(struct i2c_client *client)
431 struct adm1029_data *data = i2c_get_clientdata(client); 431 struct adm1029_data *data = i2c_get_clientdata(client);
432 int err; 432 int err;
433 433
434 hwmon_device_unregister(data->class_dev); 434 hwmon_device_unregister(data->hwmon_dev);
435 sysfs_remove_group(&client->dev.kobj, &adm1029_group); 435 sysfs_remove_group(&client->dev.kobj, &adm1029_group);
436 436
437 if ((err = i2c_detach_client(client))) 437 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c
index 122683fc91d0..37cfc101da5e 100644
--- a/drivers/hwmon/adm1031.c
+++ b/drivers/hwmon/adm1031.c
@@ -70,7 +70,7 @@ typedef u8 auto_chan_table_t[8][2];
70/* Each client has this additional data */ 70/* Each client has this additional data */
71struct adm1031_data { 71struct adm1031_data {
72 struct i2c_client client; 72 struct i2c_client client;
73 struct class_device *class_dev; 73 struct device *hwmon_dev;
74 struct mutex update_lock; 74 struct mutex update_lock;
75 int chip_type; 75 int chip_type;
76 char valid; /* !=0 if following fields are valid */ 76 char valid; /* !=0 if following fields are valid */
@@ -853,9 +853,9 @@ static int adm1031_detect(struct i2c_adapter *adapter, int address, int kind)
853 goto exit_remove; 853 goto exit_remove;
854 } 854 }
855 855
856 data->class_dev = hwmon_device_register(&new_client->dev); 856 data->hwmon_dev = hwmon_device_register(&new_client->dev);
857 if (IS_ERR(data->class_dev)) { 857 if (IS_ERR(data->hwmon_dev)) {
858 err = PTR_ERR(data->class_dev); 858 err = PTR_ERR(data->hwmon_dev);
859 goto exit_remove; 859 goto exit_remove;
860 } 860 }
861 861
@@ -877,7 +877,7 @@ static int adm1031_detach_client(struct i2c_client *client)
877 struct adm1031_data *data = i2c_get_clientdata(client); 877 struct adm1031_data *data = i2c_get_clientdata(client);
878 int ret; 878 int ret;
879 879
880 hwmon_device_unregister(data->class_dev); 880 hwmon_device_unregister(data->hwmon_dev);
881 sysfs_remove_group(&client->dev.kobj, &adm1031_group); 881 sysfs_remove_group(&client->dev.kobj, &adm1031_group);
882 sysfs_remove_group(&client->dev.kobj, &adm1031_group_opt); 882 sysfs_remove_group(&client->dev.kobj, &adm1031_group_opt);
883 if ((ret = i2c_detach_client(client)) != 0) { 883 if ((ret = i2c_detach_client(client)) != 0) {
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index aad594adf0c7..c17d0b6b3283 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -150,7 +150,7 @@ static struct i2c_driver adm9240_driver = {
150struct adm9240_data { 150struct adm9240_data {
151 enum chips type; 151 enum chips type;
152 struct i2c_client client; 152 struct i2c_client client;
153 struct class_device *class_dev; 153 struct device *hwmon_dev;
154 struct mutex update_lock; 154 struct mutex update_lock;
155 char valid; 155 char valid;
156 unsigned long last_updated_measure; 156 unsigned long last_updated_measure;
@@ -590,9 +590,9 @@ static int adm9240_detect(struct i2c_adapter *adapter, int address, int kind)
590 if ((err = sysfs_create_group(&new_client->dev.kobj, &adm9240_group))) 590 if ((err = sysfs_create_group(&new_client->dev.kobj, &adm9240_group)))
591 goto exit_detach; 591 goto exit_detach;
592 592
593 data->class_dev = hwmon_device_register(&new_client->dev); 593 data->hwmon_dev = hwmon_device_register(&new_client->dev);
594 if (IS_ERR(data->class_dev)) { 594 if (IS_ERR(data->hwmon_dev)) {
595 err = PTR_ERR(data->class_dev); 595 err = PTR_ERR(data->hwmon_dev);
596 goto exit_remove; 596 goto exit_remove;
597 } 597 }
598 598
@@ -620,7 +620,7 @@ static int adm9240_detach_client(struct i2c_client *client)
620 struct adm9240_data *data = i2c_get_clientdata(client); 620 struct adm9240_data *data = i2c_get_clientdata(client);
621 int err; 621 int err;
622 622
623 hwmon_device_unregister(data->class_dev); 623 hwmon_device_unregister(data->hwmon_dev);
624 sysfs_remove_group(&client->dev.kobj, &adm9240_group); 624 sysfs_remove_group(&client->dev.kobj, &adm9240_group);
625 625
626 if ((err = i2c_detach_client(client))) 626 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
index c4dc20546ec0..9810aaa0489d 100644
--- a/drivers/hwmon/adt7470.c
+++ b/drivers/hwmon/adt7470.c
@@ -124,7 +124,7 @@ I2C_CLIENT_INSMOD_1(adt7470);
124 124
125struct adt7470_data { 125struct adt7470_data {
126 struct i2c_client client; 126 struct i2c_client client;
127 struct class_device *class_dev; 127 struct device *hwmon_dev;
128 struct attribute_group attrs; 128 struct attribute_group attrs;
129 struct mutex lock; 129 struct mutex lock;
130 char sensors_valid; 130 char sensors_valid;
@@ -1003,9 +1003,9 @@ static int adt7470_detect(struct i2c_adapter *adapter, int address, int kind)
1003 if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs))) 1003 if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs)))
1004 goto exit_detach; 1004 goto exit_detach;
1005 1005
1006 data->class_dev = hwmon_device_register(&client->dev); 1006 data->hwmon_dev = hwmon_device_register(&client->dev);
1007 if (IS_ERR(data->class_dev)) { 1007 if (IS_ERR(data->hwmon_dev)) {
1008 err = PTR_ERR(data->class_dev); 1008 err = PTR_ERR(data->hwmon_dev);
1009 goto exit_remove; 1009 goto exit_remove;
1010 } 1010 }
1011 1011
@@ -1025,7 +1025,7 @@ static int adt7470_detach_client(struct i2c_client *client)
1025{ 1025{
1026 struct adt7470_data *data = i2c_get_clientdata(client); 1026 struct adt7470_data *data = i2c_get_clientdata(client);
1027 1027
1028 hwmon_device_unregister(data->class_dev); 1028 hwmon_device_unregister(data->hwmon_dev);
1029 sysfs_remove_group(&client->dev.kobj, &data->attrs); 1029 sysfs_remove_group(&client->dev.kobj, &data->attrs);
1030 i2c_detach_client(client); 1030 i2c_detach_client(client);
1031 kfree(data); 1031 kfree(data);
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 941729a131f5..21ff8e126889 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -127,7 +127,7 @@ static s16 rest_x;
127static s16 rest_y; 127static s16 rest_y;
128static struct timer_list applesmc_timer; 128static struct timer_list applesmc_timer;
129static struct input_dev *applesmc_idev; 129static struct input_dev *applesmc_idev;
130static struct class_device *hwmon_class_dev; 130static struct device *hwmon_dev;
131 131
132/* Indicates whether this computer has an accelerometer. */ 132/* Indicates whether this computer has an accelerometer. */
133static unsigned int applesmc_accelerometer; 133static unsigned int applesmc_accelerometer;
@@ -1287,9 +1287,9 @@ static int __init applesmc_init(void)
1287 goto out_light_wq; 1287 goto out_light_wq;
1288 } 1288 }
1289 1289
1290 hwmon_class_dev = hwmon_device_register(&pdev->dev); 1290 hwmon_dev = hwmon_device_register(&pdev->dev);
1291 if (IS_ERR(hwmon_class_dev)) { 1291 if (IS_ERR(hwmon_dev)) {
1292 ret = PTR_ERR(hwmon_class_dev); 1292 ret = PTR_ERR(hwmon_dev);
1293 goto out_light_ledclass; 1293 goto out_light_ledclass;
1294 } 1294 }
1295 1295
@@ -1331,7 +1331,7 @@ out:
1331 1331
1332static void __exit applesmc_exit(void) 1332static void __exit applesmc_exit(void)
1333{ 1333{
1334 hwmon_device_unregister(hwmon_class_dev); 1334 hwmon_device_unregister(hwmon_dev);
1335 if (applesmc_light) { 1335 if (applesmc_light) {
1336 led_classdev_unregister(&applesmc_backlight); 1336 led_classdev_unregister(&applesmc_backlight);
1337 destroy_workqueue(applesmc_led_wq); 1337 destroy_workqueue(applesmc_led_wq);
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index 55d92e1e27d1..745bf264bcfd 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -182,7 +182,7 @@ static u8 DIV_TO_REG(long val)
182 dynamically allocated, at the same time the client itself is allocated. */ 182 dynamically allocated, at the same time the client itself is allocated. */
183struct asb100_data { 183struct asb100_data {
184 struct i2c_client client; 184 struct i2c_client client;
185 struct class_device *class_dev; 185 struct device *hwmon_dev;
186 struct mutex lock; 186 struct mutex lock;
187 enum chips type; 187 enum chips type;
188 188
@@ -844,9 +844,9 @@ static int asb100_detect(struct i2c_adapter *adapter, int address, int kind)
844 if ((err = sysfs_create_group(&new_client->dev.kobj, &asb100_group))) 844 if ((err = sysfs_create_group(&new_client->dev.kobj, &asb100_group)))
845 goto ERROR3; 845 goto ERROR3;
846 846
847 data->class_dev = hwmon_device_register(&new_client->dev); 847 data->hwmon_dev = hwmon_device_register(&new_client->dev);
848 if (IS_ERR(data->class_dev)) { 848 if (IS_ERR(data->hwmon_dev)) {
849 err = PTR_ERR(data->class_dev); 849 err = PTR_ERR(data->hwmon_dev);
850 goto ERROR4; 850 goto ERROR4;
851 } 851 }
852 852
@@ -874,7 +874,7 @@ static int asb100_detach_client(struct i2c_client *client)
874 874
875 /* main client */ 875 /* main client */
876 if (data) { 876 if (data) {
877 hwmon_device_unregister(data->class_dev); 877 hwmon_device_unregister(data->hwmon_dev);
878 sysfs_remove_group(&client->dev.kobj, &asb100_group); 878 sysfs_remove_group(&client->dev.kobj, &asb100_group);
879 } 879 }
880 880
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c
index 0ccdd0750c44..cce3350e539e 100644
--- a/drivers/hwmon/atxp1.c
+++ b/drivers/hwmon/atxp1.c
@@ -61,7 +61,7 @@ static struct i2c_driver atxp1_driver = {
61 61
62struct atxp1_data { 62struct atxp1_data {
63 struct i2c_client client; 63 struct i2c_client client;
64 struct class_device *class_dev; 64 struct device *hwmon_dev;
65 struct mutex update_lock; 65 struct mutex update_lock;
66 unsigned long last_updated; 66 unsigned long last_updated;
67 u8 valid; 67 u8 valid;
@@ -335,9 +335,9 @@ static int atxp1_detect(struct i2c_adapter *adapter, int address, int kind)
335 if ((err = sysfs_create_group(&new_client->dev.kobj, &atxp1_group))) 335 if ((err = sysfs_create_group(&new_client->dev.kobj, &atxp1_group)))
336 goto exit_detach; 336 goto exit_detach;
337 337
338 data->class_dev = hwmon_device_register(&new_client->dev); 338 data->hwmon_dev = hwmon_device_register(&new_client->dev);
339 if (IS_ERR(data->class_dev)) { 339 if (IS_ERR(data->hwmon_dev)) {
340 err = PTR_ERR(data->class_dev); 340 err = PTR_ERR(data->hwmon_dev);
341 goto exit_remove_files; 341 goto exit_remove_files;
342 } 342 }
343 343
@@ -361,7 +361,7 @@ static int atxp1_detach_client(struct i2c_client * client)
361 struct atxp1_data * data = i2c_get_clientdata(client); 361 struct atxp1_data * data = i2c_get_clientdata(client);
362 int err; 362 int err;
363 363
364 hwmon_device_unregister(data->class_dev); 364 hwmon_device_unregister(data->hwmon_dev);
365 sysfs_remove_group(&client->dev.kobj, &atxp1_group); 365 sysfs_remove_group(&client->dev.kobj, &atxp1_group);
366 366
367 err = i2c_detach_client(client); 367 err = i2c_detach_client(client);
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index f7b0ef41d9cd..1a0ff8d42bb2 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -47,7 +47,7 @@ typedef enum { SHOW_TEMP, SHOW_TJMAX, SHOW_LABEL, SHOW_NAME } SHOW;
47static struct coretemp_data *coretemp_update_device(struct device *dev); 47static struct coretemp_data *coretemp_update_device(struct device *dev);
48 48
49struct coretemp_data { 49struct coretemp_data {
50 struct class_device *class_dev; 50 struct device *hwmon_dev;
51 struct mutex update_lock; 51 struct mutex update_lock;
52 const char *name; 52 const char *name;
53 u32 id; 53 u32 id;
@@ -226,9 +226,9 @@ static int __devinit coretemp_probe(struct platform_device *pdev)
226 if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group))) 226 if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
227 goto exit_free; 227 goto exit_free;
228 228
229 data->class_dev = hwmon_device_register(&pdev->dev); 229 data->hwmon_dev = hwmon_device_register(&pdev->dev);
230 if (IS_ERR(data->class_dev)) { 230 if (IS_ERR(data->hwmon_dev)) {
231 err = PTR_ERR(data->class_dev); 231 err = PTR_ERR(data->hwmon_dev);
232 dev_err(&pdev->dev, "Class registration failed (%d)\n", 232 dev_err(&pdev->dev, "Class registration failed (%d)\n",
233 err); 233 err);
234 goto exit_class; 234 goto exit_class;
@@ -248,7 +248,7 @@ static int __devexit coretemp_remove(struct platform_device *pdev)
248{ 248{
249 struct coretemp_data *data = platform_get_drvdata(pdev); 249 struct coretemp_data *data = platform_get_drvdata(pdev);
250 250
251 hwmon_device_unregister(data->class_dev); 251 hwmon_device_unregister(data->hwmon_dev);
252 sysfs_remove_group(&pdev->dev.kobj, &coretemp_group); 252 sysfs_remove_group(&pdev->dev.kobj, &coretemp_group);
253 platform_set_drvdata(pdev, NULL); 253 platform_set_drvdata(pdev, NULL);
254 kfree(data); 254 kfree(data);
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c
index e9cbc727664d..14ebbfb3b14b 100644
--- a/drivers/hwmon/dme1737.c
+++ b/drivers/hwmon/dme1737.c
@@ -155,7 +155,7 @@ static const u8 DME1737_BIT_ALARM_FAN[] = {10, 11, 12, 13, 22, 23};
155 155
156struct dme1737_data { 156struct dme1737_data {
157 struct i2c_client client; 157 struct i2c_client client;
158 struct class_device *class_dev; 158 struct device *hwmon_dev;
159 159
160 struct mutex update_lock; 160 struct mutex update_lock;
161 int valid; /* !=0 if following fields are valid */ 161 int valid; /* !=0 if following fields are valid */
@@ -1983,9 +1983,9 @@ static int dme1737_detect(struct i2c_adapter *adapter, int address,
1983 } 1983 }
1984 1984
1985 /* Register device */ 1985 /* Register device */
1986 data->class_dev = hwmon_device_register(&client->dev); 1986 data->hwmon_dev = hwmon_device_register(&client->dev);
1987 if (IS_ERR(data->class_dev)) { 1987 if (IS_ERR(data->hwmon_dev)) {
1988 err = PTR_ERR(data->class_dev); 1988 err = PTR_ERR(data->hwmon_dev);
1989 goto exit_remove; 1989 goto exit_remove;
1990 } 1990 }
1991 1991
@@ -2030,7 +2030,7 @@ static int dme1737_detach_client(struct i2c_client *client)
2030 struct dme1737_data *data = i2c_get_clientdata(client); 2030 struct dme1737_data *data = i2c_get_clientdata(client);
2031 int ix, err; 2031 int ix, err;
2032 2032
2033 hwmon_device_unregister(data->class_dev); 2033 hwmon_device_unregister(data->hwmon_dev);
2034 2034
2035 for (ix = 0; ix < ARRAY_SIZE(dme1737_fan_group); ix++) { 2035 for (ix = 0; ix < ARRAY_SIZE(dme1737_fan_group); ix++) {
2036 if (data->has_fan & (1 << ix)) { 2036 if (data->has_fan & (1 << ix)) {
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index 5a861f936120..b7bd000b130f 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -73,7 +73,7 @@ static const u8 DS1621_REG_TEMP[3] = {
73/* Each client has this additional data */ 73/* Each client has this additional data */
74struct ds1621_data { 74struct ds1621_data {
75 struct i2c_client client; 75 struct i2c_client client;
76 struct class_device *class_dev; 76 struct device *hwmon_dev;
77 struct mutex update_lock; 77 struct mutex update_lock;
78 char valid; /* !=0 if following fields are valid */ 78 char valid; /* !=0 if following fields are valid */
79 unsigned long last_updated; /* In jiffies */ 79 unsigned long last_updated; /* In jiffies */
@@ -266,9 +266,9 @@ static int ds1621_detect(struct i2c_adapter *adapter, int address,
266 if ((err = sysfs_create_group(&client->dev.kobj, &ds1621_group))) 266 if ((err = sysfs_create_group(&client->dev.kobj, &ds1621_group)))
267 goto exit_detach; 267 goto exit_detach;
268 268
269 data->class_dev = hwmon_device_register(&client->dev); 269 data->hwmon_dev = hwmon_device_register(&client->dev);
270 if (IS_ERR(data->class_dev)) { 270 if (IS_ERR(data->hwmon_dev)) {
271 err = PTR_ERR(data->class_dev); 271 err = PTR_ERR(data->hwmon_dev);
272 goto exit_remove_files; 272 goto exit_remove_files;
273 } 273 }
274 274
@@ -289,7 +289,7 @@ static int ds1621_detach_client(struct i2c_client *client)
289 struct ds1621_data *data = i2c_get_clientdata(client); 289 struct ds1621_data *data = i2c_get_clientdata(client);
290 int err; 290 int err;
291 291
292 hwmon_device_unregister(data->class_dev); 292 hwmon_device_unregister(data->hwmon_dev);
293 sysfs_remove_group(&client->dev.kobj, &ds1621_group); 293 sysfs_remove_group(&client->dev.kobj, &ds1621_group);
294 294
295 if ((err = i2c_detach_client(client))) 295 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/f71805f.c b/drivers/hwmon/f71805f.c
index 1cd71a5be0ea..5d9d5cc816a2 100644
--- a/drivers/hwmon/f71805f.c
+++ b/drivers/hwmon/f71805f.c
@@ -162,7 +162,7 @@ struct f71805f_auto_point {
162struct f71805f_data { 162struct f71805f_data {
163 unsigned short addr; 163 unsigned short addr;
164 const char *name; 164 const char *name;
165 struct class_device *class_dev; 165 struct device *hwmon_dev;
166 166
167 struct mutex update_lock; 167 struct mutex update_lock;
168 char valid; /* !=0 if following fields are valid */ 168 char valid; /* !=0 if following fields are valid */
@@ -1381,9 +1381,9 @@ static int __devinit f71805f_probe(struct platform_device *pdev)
1381 } 1381 }
1382 } 1382 }
1383 1383
1384 data->class_dev = hwmon_device_register(&pdev->dev); 1384 data->hwmon_dev = hwmon_device_register(&pdev->dev);
1385 if (IS_ERR(data->class_dev)) { 1385 if (IS_ERR(data->hwmon_dev)) {
1386 err = PTR_ERR(data->class_dev); 1386 err = PTR_ERR(data->hwmon_dev);
1387 dev_err(&pdev->dev, "Class registration failed (%d)\n", err); 1387 dev_err(&pdev->dev, "Class registration failed (%d)\n", err);
1388 goto exit_remove_files; 1388 goto exit_remove_files;
1389 } 1389 }
@@ -1410,7 +1410,7 @@ static int __devexit f71805f_remove(struct platform_device *pdev)
1410 struct resource *res; 1410 struct resource *res;
1411 int i; 1411 int i;
1412 1412
1413 hwmon_device_unregister(data->class_dev); 1413 hwmon_device_unregister(data->hwmon_dev);
1414 sysfs_remove_group(&pdev->dev.kobj, &f71805f_group); 1414 sysfs_remove_group(&pdev->dev.kobj, &f71805f_group);
1415 for (i = 0; i < 4; i++) 1415 for (i = 0; i < 4; i++)
1416 sysfs_remove_group(&pdev->dev.kobj, &f71805f_group_optin[i]); 1416 sysfs_remove_group(&pdev->dev.kobj, &f71805f_group_optin[i]);
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index b4ff0f9a6af0..6db74434a02e 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -87,7 +87,7 @@ static inline u16 fan_from_reg ( u16 reg );
87 87
88struct f71882fg_data { 88struct f71882fg_data {
89 unsigned short addr; 89 unsigned short addr;
90 struct class_device *class_dev; 90 struct device *hwmon_dev;
91 91
92 struct mutex update_lock; 92 struct mutex update_lock;
93 char valid; /* !=0 if following fields are valid */ 93 char valid; /* !=0 if following fields are valid */
@@ -781,9 +781,9 @@ static int __devinit f71882fg_probe(struct platform_device * pdev)
781 } 781 }
782 } 782 }
783 783
784 data->class_dev = hwmon_device_register(&pdev->dev); 784 data->hwmon_dev = hwmon_device_register(&pdev->dev);
785 if (IS_ERR(data->class_dev)) { 785 if (IS_ERR(data->hwmon_dev)) {
786 err = PTR_ERR(data->class_dev); 786 err = PTR_ERR(data->hwmon_dev);
787 goto exit_unregister_sysfs; 787 goto exit_unregister_sysfs;
788 } 788 }
789 789
@@ -811,7 +811,7 @@ static int __devexit f71882fg_remove(struct platform_device *pdev)
811 struct f71882fg_data *data = platform_get_drvdata(pdev); 811 struct f71882fg_data *data = platform_get_drvdata(pdev);
812 812
813 platform_set_drvdata(pdev, NULL); 813 platform_set_drvdata(pdev, NULL);
814 hwmon_device_unregister(data->class_dev); 814 hwmon_device_unregister(data->hwmon_dev);
815 815
816 for (i = 0; i < ARRAY_SIZE(f71882fg_dev_attr); i++) 816 for (i = 0; i < ARRAY_SIZE(f71882fg_dev_attr); i++)
817 device_remove_file(&pdev->dev, &f71882fg_dev_attr[i]); 817 device_remove_file(&pdev->dev, &f71882fg_dev_attr[i]);
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index 6425184d9316..13a041326a04 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -87,7 +87,7 @@ I2C_CLIENT_INSMOD_2(f75373, f75375);
87struct f75375_data { 87struct f75375_data {
88 unsigned short addr; 88 unsigned short addr;
89 struct i2c_client client; 89 struct i2c_client client;
90 struct class_device *class_dev; 90 struct device *hwmon_dev;
91 91
92 const char *name; 92 const char *name;
93 int kind; 93 int kind;
@@ -583,7 +583,7 @@ static int f75375_detach_client(struct i2c_client *client)
583 struct f75375_data *data = i2c_get_clientdata(client); 583 struct f75375_data *data = i2c_get_clientdata(client);
584 int err; 584 int err;
585 585
586 hwmon_device_unregister(data->class_dev); 586 hwmon_device_unregister(data->hwmon_dev);
587 sysfs_remove_group(&client->dev.kobj, &f75375_group); 587 sysfs_remove_group(&client->dev.kobj, &f75375_group);
588 588
589 err = i2c_detach_client(client); 589 err = i2c_detach_client(client);
@@ -655,9 +655,9 @@ static int f75375_detect(struct i2c_adapter *adapter, int address, int kind)
655 if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group))) 655 if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group)))
656 goto exit_detach; 656 goto exit_detach;
657 657
658 data->class_dev = hwmon_device_register(&client->dev); 658 data->hwmon_dev = hwmon_device_register(&client->dev);
659 if (IS_ERR(data->class_dev)) { 659 if (IS_ERR(data->hwmon_dev)) {
660 err = PTR_ERR(data->class_dev); 660 err = PTR_ERR(data->hwmon_dev);
661 goto exit_remove; 661 goto exit_remove;
662 } 662 }
663 663
diff --git a/drivers/hwmon/fscher.c b/drivers/hwmon/fscher.c
index b34b546c68b8..e67c36953b2d 100644
--- a/drivers/hwmon/fscher.c
+++ b/drivers/hwmon/fscher.c
@@ -134,7 +134,7 @@ static struct i2c_driver fscher_driver = {
134 134
135struct fscher_data { 135struct fscher_data {
136 struct i2c_client client; 136 struct i2c_client client;
137 struct class_device *class_dev; 137 struct device *hwmon_dev;
138 struct mutex update_lock; 138 struct mutex update_lock;
139 char valid; /* zero until following fields are valid */ 139 char valid; /* zero until following fields are valid */
140 unsigned long last_updated; /* in jiffies */ 140 unsigned long last_updated; /* in jiffies */
@@ -344,9 +344,9 @@ static int fscher_detect(struct i2c_adapter *adapter, int address, int kind)
344 if ((err = sysfs_create_group(&new_client->dev.kobj, &fscher_group))) 344 if ((err = sysfs_create_group(&new_client->dev.kobj, &fscher_group)))
345 goto exit_detach; 345 goto exit_detach;
346 346
347 data->class_dev = hwmon_device_register(&new_client->dev); 347 data->hwmon_dev = hwmon_device_register(&new_client->dev);
348 if (IS_ERR(data->class_dev)) { 348 if (IS_ERR(data->hwmon_dev)) {
349 err = PTR_ERR(data->class_dev); 349 err = PTR_ERR(data->hwmon_dev);
350 goto exit_remove_files; 350 goto exit_remove_files;
351 } 351 }
352 352
@@ -367,7 +367,7 @@ static int fscher_detach_client(struct i2c_client *client)
367 struct fscher_data *data = i2c_get_clientdata(client); 367 struct fscher_data *data = i2c_get_clientdata(client);
368 int err; 368 int err;
369 369
370 hwmon_device_unregister(data->class_dev); 370 hwmon_device_unregister(data->hwmon_dev);
371 sysfs_remove_group(&client->dev.kobj, &fscher_group); 371 sysfs_remove_group(&client->dev.kobj, &fscher_group);
372 372
373 if ((err = i2c_detach_client(client))) 373 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/fscpos.c b/drivers/hwmon/fscpos.c
index ea506a77f9c9..92c9703d0ac0 100644
--- a/drivers/hwmon/fscpos.c
+++ b/drivers/hwmon/fscpos.c
@@ -115,7 +115,7 @@ static struct i2c_driver fscpos_driver = {
115 */ 115 */
116struct fscpos_data { 116struct fscpos_data {
117 struct i2c_client client; 117 struct i2c_client client;
118 struct class_device *class_dev; 118 struct device *hwmon_dev;
119 struct mutex update_lock; 119 struct mutex update_lock;
120 char valid; /* 0 until following fields are valid */ 120 char valid; /* 0 until following fields are valid */
121 unsigned long last_updated; /* In jiffies */ 121 unsigned long last_updated; /* In jiffies */
@@ -539,9 +539,9 @@ static int fscpos_detect(struct i2c_adapter *adapter, int address, int kind)
539 if ((err = sysfs_create_group(&new_client->dev.kobj, &fscpos_group))) 539 if ((err = sysfs_create_group(&new_client->dev.kobj, &fscpos_group)))
540 goto exit_detach; 540 goto exit_detach;
541 541
542 data->class_dev = hwmon_device_register(&new_client->dev); 542 data->hwmon_dev = hwmon_device_register(&new_client->dev);
543 if (IS_ERR(data->class_dev)) { 543 if (IS_ERR(data->hwmon_dev)) {
544 err = PTR_ERR(data->class_dev); 544 err = PTR_ERR(data->hwmon_dev);
545 goto exit_remove_files; 545 goto exit_remove_files;
546 } 546 }
547 547
@@ -562,7 +562,7 @@ static int fscpos_detach_client(struct i2c_client *client)
562 struct fscpos_data *data = i2c_get_clientdata(client); 562 struct fscpos_data *data = i2c_get_clientdata(client);
563 int err; 563 int err;
564 564
565 hwmon_device_unregister(data->class_dev); 565 hwmon_device_unregister(data->hwmon_dev);
566 sysfs_remove_group(&client->dev.kobj, &fscpos_group); 566 sysfs_remove_group(&client->dev.kobj, &fscpos_group);
567 567
568 if ((err = i2c_detach_client(client))) 568 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c
index c103640455a3..bb58d9866a37 100644
--- a/drivers/hwmon/gl518sm.c
+++ b/drivers/hwmon/gl518sm.c
@@ -119,7 +119,7 @@ static inline u8 FAN_TO_REG(long rpm, int div)
119/* Each client has this additional data */ 119/* Each client has this additional data */
120struct gl518_data { 120struct gl518_data {
121 struct i2c_client client; 121 struct i2c_client client;
122 struct class_device *class_dev; 122 struct device *hwmon_dev;
123 enum chips type; 123 enum chips type;
124 124
125 struct mutex update_lock; 125 struct mutex update_lock;
@@ -460,9 +460,9 @@ static int gl518_detect(struct i2c_adapter *adapter, int address, int kind)
460 if ((err = sysfs_create_group(&new_client->dev.kobj, &gl518_group))) 460 if ((err = sysfs_create_group(&new_client->dev.kobj, &gl518_group)))
461 goto exit_detach; 461 goto exit_detach;
462 462
463 data->class_dev = hwmon_device_register(&new_client->dev); 463 data->hwmon_dev = hwmon_device_register(&new_client->dev);
464 if (IS_ERR(data->class_dev)) { 464 if (IS_ERR(data->hwmon_dev)) {
465 err = PTR_ERR(data->class_dev); 465 err = PTR_ERR(data->hwmon_dev);
466 goto exit_remove_files; 466 goto exit_remove_files;
467 } 467 }
468 468
@@ -502,7 +502,7 @@ static int gl518_detach_client(struct i2c_client *client)
502 struct gl518_data *data = i2c_get_clientdata(client); 502 struct gl518_data *data = i2c_get_clientdata(client);
503 int err; 503 int err;
504 504
505 hwmon_device_unregister(data->class_dev); 505 hwmon_device_unregister(data->hwmon_dev);
506 sysfs_remove_group(&client->dev.kobj, &gl518_group); 506 sysfs_remove_group(&client->dev.kobj, &gl518_group);
507 507
508 if ((err = i2c_detach_client(client))) 508 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c
index ebe7b9aaa916..a3b56c816e11 100644
--- a/drivers/hwmon/gl520sm.c
+++ b/drivers/hwmon/gl520sm.c
@@ -122,7 +122,7 @@ static struct i2c_driver gl520_driver = {
122/* Client data */ 122/* Client data */
123struct gl520_data { 123struct gl520_data {
124 struct i2c_client client; 124 struct i2c_client client;
125 struct class_device *class_dev; 125 struct device *hwmon_dev;
126 struct mutex update_lock; 126 struct mutex update_lock;
127 char valid; /* zero until the following fields are valid */ 127 char valid; /* zero until the following fields are valid */
128 unsigned long last_updated; /* in jiffies */ 128 unsigned long last_updated; /* in jiffies */
@@ -622,9 +622,9 @@ static int gl520_detect(struct i2c_adapter *adapter, int address, int kind)
622 } 622 }
623 623
624 624
625 data->class_dev = hwmon_device_register(&new_client->dev); 625 data->hwmon_dev = hwmon_device_register(&new_client->dev);
626 if (IS_ERR(data->class_dev)) { 626 if (IS_ERR(data->hwmon_dev)) {
627 err = PTR_ERR(data->class_dev); 627 err = PTR_ERR(data->hwmon_dev);
628 goto exit_remove_files; 628 goto exit_remove_files;
629 } 629 }
630 630
@@ -685,7 +685,7 @@ static int gl520_detach_client(struct i2c_client *client)
685 struct gl520_data *data = i2c_get_clientdata(client); 685 struct gl520_data *data = i2c_get_clientdata(client);
686 int err; 686 int err;
687 687
688 hwmon_device_unregister(data->class_dev); 688 hwmon_device_unregister(data->hwmon_dev);
689 sysfs_remove_group(&client->dev.kobj, &gl520_group); 689 sysfs_remove_group(&client->dev.kobj, &gl520_group);
690 sysfs_remove_group(&client->dev.kobj, &gl520_group_opt); 690 sysfs_remove_group(&client->dev.kobj, &gl520_group_opt);
691 691
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
index affcc00764d3..3db28450a3b3 100644
--- a/drivers/hwmon/hwmon.c
+++ b/drivers/hwmon/hwmon.c
@@ -28,17 +28,17 @@ static DEFINE_IDR(hwmon_idr);
28static DEFINE_SPINLOCK(idr_lock); 28static DEFINE_SPINLOCK(idr_lock);
29 29
30/** 30/**
31 * hwmon_device_register - register w/ hwmon sysfs class 31 * hwmon_device_register - register w/ hwmon
32 * @dev: the device to register 32 * @dev: the device to register
33 * 33 *
34 * hwmon_device_unregister() must be called when the class device is no 34 * hwmon_device_unregister() must be called when the device is no
35 * longer needed. 35 * longer needed.
36 * 36 *
37 * Returns the pointer to the new struct class device. 37 * Returns the pointer to the new device.
38 */ 38 */
39struct class_device *hwmon_device_register(struct device *dev) 39struct device *hwmon_device_register(struct device *dev)
40{ 40{
41 struct class_device *cdev; 41 struct device *hwdev;
42 int id, err; 42 int id, err;
43 43
44again: 44again:
@@ -55,34 +55,33 @@ again:
55 return ERR_PTR(err); 55 return ERR_PTR(err);
56 56
57 id = id & MAX_ID_MASK; 57 id = id & MAX_ID_MASK;
58 cdev = class_device_create(hwmon_class, NULL, MKDEV(0,0), dev, 58 hwdev = device_create(hwmon_class, dev, MKDEV(0,0), HWMON_ID_FORMAT, id);
59 HWMON_ID_FORMAT, id);
60 59
61 if (IS_ERR(cdev)) { 60 if (IS_ERR(hwdev)) {
62 spin_lock(&idr_lock); 61 spin_lock(&idr_lock);
63 idr_remove(&hwmon_idr, id); 62 idr_remove(&hwmon_idr, id);
64 spin_unlock(&idr_lock); 63 spin_unlock(&idr_lock);
65 } 64 }
66 65
67 return cdev; 66 return hwdev;
68} 67}
69 68
70/** 69/**
71 * hwmon_device_unregister - removes the previously registered class device 70 * hwmon_device_unregister - removes the previously registered class device
72 * 71 *
73 * @cdev: the class device to destroy 72 * @dev: the class device to destroy
74 */ 73 */
75void hwmon_device_unregister(struct class_device *cdev) 74void hwmon_device_unregister(struct device *dev)
76{ 75{
77 int id; 76 int id;
78 77
79 if (likely(sscanf(cdev->class_id, HWMON_ID_FORMAT, &id) == 1)) { 78 if (likely(sscanf(dev->bus_id, HWMON_ID_FORMAT, &id) == 1)) {
80 class_device_unregister(cdev); 79 device_unregister(dev);
81 spin_lock(&idr_lock); 80 spin_lock(&idr_lock);
82 idr_remove(&hwmon_idr, id); 81 idr_remove(&hwmon_idr, id);
83 spin_unlock(&idr_lock); 82 spin_unlock(&idr_lock);
84 } else 83 } else
85 dev_dbg(cdev->dev, 84 dev_dbg(dev->parent,
86 "hwmon_device_unregister() failed: bad class ID!\n"); 85 "hwmon_device_unregister() failed: bad class ID!\n");
87} 86}
88 87
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index d75dba9b810b..41a90e5613bc 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -222,7 +222,7 @@ struct it87_sio_data {
222/* For each registered chip, we need to keep some data in memory. 222/* For each registered chip, we need to keep some data in memory.
223 The structure is dynamically allocated. */ 223 The structure is dynamically allocated. */
224struct it87_data { 224struct it87_data {
225 struct class_device *class_dev; 225 struct device *hwmon_dev;
226 enum chips type; 226 enum chips type;
227 227
228 unsigned short addr; 228 unsigned short addr;
@@ -1089,9 +1089,9 @@ static int __devinit it87_probe(struct platform_device *pdev)
1089 goto ERROR4; 1089 goto ERROR4;
1090 } 1090 }
1091 1091
1092 data->class_dev = hwmon_device_register(dev); 1092 data->hwmon_dev = hwmon_device_register(dev);
1093 if (IS_ERR(data->class_dev)) { 1093 if (IS_ERR(data->hwmon_dev)) {
1094 err = PTR_ERR(data->class_dev); 1094 err = PTR_ERR(data->hwmon_dev);
1095 goto ERROR4; 1095 goto ERROR4;
1096 } 1096 }
1097 1097
@@ -1113,7 +1113,7 @@ static int __devexit it87_remove(struct platform_device *pdev)
1113{ 1113{
1114 struct it87_data *data = platform_get_drvdata(pdev); 1114 struct it87_data *data = platform_get_drvdata(pdev);
1115 1115
1116 hwmon_device_unregister(data->class_dev); 1116 hwmon_device_unregister(data->hwmon_dev);
1117 sysfs_remove_group(&pdev->dev.kobj, &it87_group); 1117 sysfs_remove_group(&pdev->dev.kobj, &it87_group);
1118 sysfs_remove_group(&pdev->dev.kobj, &it87_group_opt); 1118 sysfs_remove_group(&pdev->dev.kobj, &it87_group_opt);
1119 1119
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c
index 5d8d0ca08fa9..bd2bde0ef95e 100644
--- a/drivers/hwmon/k8temp.c
+++ b/drivers/hwmon/k8temp.c
@@ -38,7 +38,7 @@
38#define SEL_CORE 0x04 38#define SEL_CORE 0x04
39 39
40struct k8temp_data { 40struct k8temp_data {
41 struct class_device *class_dev; 41 struct device *hwmon_dev;
42 struct mutex update_lock; 42 struct mutex update_lock;
43 const char *name; 43 const char *name;
44 char valid; /* zero until following fields are valid */ 44 char valid; /* zero until following fields are valid */
@@ -225,10 +225,10 @@ static int __devinit k8temp_probe(struct pci_dev *pdev,
225 if (err) 225 if (err)
226 goto exit_remove; 226 goto exit_remove;
227 227
228 data->class_dev = hwmon_device_register(&pdev->dev); 228 data->hwmon_dev = hwmon_device_register(&pdev->dev);
229 229
230 if (IS_ERR(data->class_dev)) { 230 if (IS_ERR(data->hwmon_dev)) {
231 err = PTR_ERR(data->class_dev); 231 err = PTR_ERR(data->hwmon_dev);
232 goto exit_remove; 232 goto exit_remove;
233 } 233 }
234 234
@@ -255,7 +255,7 @@ static void __devexit k8temp_remove(struct pci_dev *pdev)
255{ 255{
256 struct k8temp_data *data = dev_get_drvdata(&pdev->dev); 256 struct k8temp_data *data = dev_get_drvdata(&pdev->dev);
257 257
258 hwmon_device_unregister(data->class_dev); 258 hwmon_device_unregister(data->hwmon_dev);
259 device_remove_file(&pdev->dev, 259 device_remove_file(&pdev->dev,
260 &sensor_dev_attr_temp1_input.dev_attr); 260 &sensor_dev_attr_temp1_input.dev_attr);
261 device_remove_file(&pdev->dev, 261 device_remove_file(&pdev->dev,
diff --git a/drivers/hwmon/lm63.c b/drivers/hwmon/lm63.c
index 2162d69a8c06..f207434730de 100644
--- a/drivers/hwmon/lm63.c
+++ b/drivers/hwmon/lm63.c
@@ -154,7 +154,7 @@ static struct i2c_driver lm63_driver = {
154 154
155struct lm63_data { 155struct lm63_data {
156 struct i2c_client client; 156 struct i2c_client client;
157 struct class_device *class_dev; 157 struct device *hwmon_dev;
158 struct mutex update_lock; 158 struct mutex update_lock;
159 char valid; /* zero until following fields are valid */ 159 char valid; /* zero until following fields are valid */
160 unsigned long last_updated; /* in jiffies */ 160 unsigned long last_updated; /* in jiffies */
@@ -502,9 +502,9 @@ static int lm63_detect(struct i2c_adapter *adapter, int address, int kind)
502 goto exit_remove_files; 502 goto exit_remove_files;
503 } 503 }
504 504
505 data->class_dev = hwmon_device_register(&new_client->dev); 505 data->hwmon_dev = hwmon_device_register(&new_client->dev);
506 if (IS_ERR(data->class_dev)) { 506 if (IS_ERR(data->hwmon_dev)) {
507 err = PTR_ERR(data->class_dev); 507 err = PTR_ERR(data->hwmon_dev);
508 goto exit_remove_files; 508 goto exit_remove_files;
509 } 509 }
510 510
@@ -561,7 +561,7 @@ static int lm63_detach_client(struct i2c_client *client)
561 struct lm63_data *data = i2c_get_clientdata(client); 561 struct lm63_data *data = i2c_get_clientdata(client);
562 int err; 562 int err;
563 563
564 hwmon_device_unregister(data->class_dev); 564 hwmon_device_unregister(data->hwmon_dev);
565 sysfs_remove_group(&client->dev.kobj, &lm63_group); 565 sysfs_remove_group(&client->dev.kobj, &lm63_group);
566 sysfs_remove_group(&client->dev.kobj, &lm63_group_fan1); 566 sysfs_remove_group(&client->dev.kobj, &lm63_group_fan1);
567 567
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
index 30b9b2be87b9..dd366889ce9b 100644
--- a/drivers/hwmon/lm70.c
+++ b/drivers/hwmon/lm70.c
@@ -37,7 +37,7 @@
37#define DRVNAME "lm70" 37#define DRVNAME "lm70"
38 38
39struct lm70 { 39struct lm70 {
40 struct class_device *cdev; 40 struct device *hwmon_dev;
41 struct semaphore sem; 41 struct semaphore sem;
42}; 42};
43 43
@@ -115,10 +115,10 @@ static int __devinit lm70_probe(struct spi_device *spi)
115 init_MUTEX(&p_lm70->sem); 115 init_MUTEX(&p_lm70->sem);
116 116
117 /* sysfs hook */ 117 /* sysfs hook */
118 p_lm70->cdev = hwmon_device_register(&spi->dev); 118 p_lm70->hwmon_dev = hwmon_device_register(&spi->dev);
119 if (IS_ERR(p_lm70->cdev)) { 119 if (IS_ERR(p_lm70->hwmon_dev)) {
120 dev_dbg(&spi->dev, "hwmon_device_register failed.\n"); 120 dev_dbg(&spi->dev, "hwmon_device_register failed.\n");
121 status = PTR_ERR(p_lm70->cdev); 121 status = PTR_ERR(p_lm70->hwmon_dev);
122 goto out_dev_reg_failed; 122 goto out_dev_reg_failed;
123 } 123 }
124 dev_set_drvdata(&spi->dev, p_lm70); 124 dev_set_drvdata(&spi->dev, p_lm70);
@@ -133,7 +133,7 @@ static int __devinit lm70_probe(struct spi_device *spi)
133 133
134out_dev_create_file_failed: 134out_dev_create_file_failed:
135 device_remove_file(&spi->dev, &dev_attr_temp1_input); 135 device_remove_file(&spi->dev, &dev_attr_temp1_input);
136 hwmon_device_unregister(p_lm70->cdev); 136 hwmon_device_unregister(p_lm70->hwmon_dev);
137out_dev_reg_failed: 137out_dev_reg_failed:
138 dev_set_drvdata(&spi->dev, NULL); 138 dev_set_drvdata(&spi->dev, NULL);
139 kfree(p_lm70); 139 kfree(p_lm70);
@@ -146,7 +146,7 @@ static int __devexit lm70_remove(struct spi_device *spi)
146 146
147 device_remove_file(&spi->dev, &dev_attr_temp1_input); 147 device_remove_file(&spi->dev, &dev_attr_temp1_input);
148 device_remove_file(&spi->dev, &dev_attr_name); 148 device_remove_file(&spi->dev, &dev_attr_name);
149 hwmon_device_unregister(p_lm70->cdev); 149 hwmon_device_unregister(p_lm70->hwmon_dev);
150 dev_set_drvdata(&spi->dev, NULL); 150 dev_set_drvdata(&spi->dev, NULL);
151 kfree(p_lm70); 151 kfree(p_lm70);
152 152
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 4fa32205e44c..37a8cc032ffa 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -50,7 +50,7 @@ static const u8 LM75_REG_TEMP[3] = {
50/* Each client has this additional data */ 50/* Each client has this additional data */
51struct lm75_data { 51struct lm75_data {
52 struct i2c_client client; 52 struct i2c_client client;
53 struct class_device *class_dev; 53 struct device *hwmon_dev;
54 struct mutex update_lock; 54 struct mutex update_lock;
55 char valid; /* !=0 if following fields are valid */ 55 char valid; /* !=0 if following fields are valid */
56 unsigned long last_updated; /* In jiffies */ 56 unsigned long last_updated; /* In jiffies */
@@ -219,9 +219,9 @@ static int lm75_detect(struct i2c_adapter *adapter, int address, int kind)
219 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm75_group))) 219 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm75_group)))
220 goto exit_detach; 220 goto exit_detach;
221 221
222 data->class_dev = hwmon_device_register(&new_client->dev); 222 data->hwmon_dev = hwmon_device_register(&new_client->dev);
223 if (IS_ERR(data->class_dev)) { 223 if (IS_ERR(data->hwmon_dev)) {
224 err = PTR_ERR(data->class_dev); 224 err = PTR_ERR(data->hwmon_dev);
225 goto exit_remove; 225 goto exit_remove;
226 } 226 }
227 227
@@ -240,7 +240,7 @@ exit:
240static int lm75_detach_client(struct i2c_client *client) 240static int lm75_detach_client(struct i2c_client *client)
241{ 241{
242 struct lm75_data *data = i2c_get_clientdata(client); 242 struct lm75_data *data = i2c_get_clientdata(client);
243 hwmon_device_unregister(data->class_dev); 243 hwmon_device_unregister(data->hwmon_dev);
244 sysfs_remove_group(&client->dev.kobj, &lm75_group); 244 sysfs_remove_group(&client->dev.kobj, &lm75_group);
245 i2c_detach_client(client); 245 i2c_detach_client(client);
246 kfree(data); 246 kfree(data);
diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c
index 46e3abad7206..cee5c2e8cfad 100644
--- a/drivers/hwmon/lm77.c
+++ b/drivers/hwmon/lm77.c
@@ -51,7 +51,7 @@ I2C_CLIENT_INSMOD_1(lm77);
51/* Each client has this additional data */ 51/* Each client has this additional data */
52struct lm77_data { 52struct lm77_data {
53 struct i2c_client client; 53 struct i2c_client client;
54 struct class_device *class_dev; 54 struct device *hwmon_dev;
55 struct mutex update_lock; 55 struct mutex update_lock;
56 char valid; 56 char valid;
57 unsigned long last_updated; /* In jiffies */ 57 unsigned long last_updated; /* In jiffies */
@@ -337,9 +337,9 @@ static int lm77_detect(struct i2c_adapter *adapter, int address, int kind)
337 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm77_group))) 337 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm77_group)))
338 goto exit_detach; 338 goto exit_detach;
339 339
340 data->class_dev = hwmon_device_register(&new_client->dev); 340 data->hwmon_dev = hwmon_device_register(&new_client->dev);
341 if (IS_ERR(data->class_dev)) { 341 if (IS_ERR(data->hwmon_dev)) {
342 err = PTR_ERR(data->class_dev); 342 err = PTR_ERR(data->hwmon_dev);
343 goto exit_remove; 343 goto exit_remove;
344 } 344 }
345 345
@@ -358,7 +358,7 @@ exit:
358static int lm77_detach_client(struct i2c_client *client) 358static int lm77_detach_client(struct i2c_client *client)
359{ 359{
360 struct lm77_data *data = i2c_get_clientdata(client); 360 struct lm77_data *data = i2c_get_clientdata(client);
361 hwmon_device_unregister(data->class_dev); 361 hwmon_device_unregister(data->hwmon_dev);
362 sysfs_remove_group(&client->dev.kobj, &lm77_group); 362 sysfs_remove_group(&client->dev.kobj, &lm77_group);
363 i2c_detach_client(client); 363 i2c_detach_client(client);
364 kfree(data); 364 kfree(data);
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c
index 6eea3476b90c..f5278fda8268 100644
--- a/drivers/hwmon/lm78.c
+++ b/drivers/hwmon/lm78.c
@@ -131,7 +131,7 @@ static inline int TEMP_FROM_REG(s8 val)
131 the driver field to differentiate between I2C and ISA chips. */ 131 the driver field to differentiate between I2C and ISA chips. */
132struct lm78_data { 132struct lm78_data {
133 struct i2c_client client; 133 struct i2c_client client;
134 struct class_device *class_dev; 134 struct device *hwmon_dev;
135 struct mutex lock; 135 struct mutex lock;
136 enum chips type; 136 enum chips type;
137 137
@@ -585,9 +585,9 @@ static int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
585 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm78_group))) 585 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm78_group)))
586 goto ERROR3; 586 goto ERROR3;
587 587
588 data->class_dev = hwmon_device_register(&new_client->dev); 588 data->hwmon_dev = hwmon_device_register(&new_client->dev);
589 if (IS_ERR(data->class_dev)) { 589 if (IS_ERR(data->hwmon_dev)) {
590 err = PTR_ERR(data->class_dev); 590 err = PTR_ERR(data->hwmon_dev);
591 goto ERROR4; 591 goto ERROR4;
592 } 592 }
593 593
@@ -608,7 +608,7 @@ static int lm78_detach_client(struct i2c_client *client)
608 struct lm78_data *data = i2c_get_clientdata(client); 608 struct lm78_data *data = i2c_get_clientdata(client);
609 int err; 609 int err;
610 610
611 hwmon_device_unregister(data->class_dev); 611 hwmon_device_unregister(data->hwmon_dev);
612 sysfs_remove_group(&client->dev.kobj, &lm78_group); 612 sysfs_remove_group(&client->dev.kobj, &lm78_group);
613 613
614 if ((err = i2c_detach_client(client))) 614 if ((err = i2c_detach_client(client)))
@@ -659,9 +659,9 @@ static int __devinit lm78_isa_probe(struct platform_device *pdev)
659 || (err = device_create_file(&pdev->dev, &dev_attr_name))) 659 || (err = device_create_file(&pdev->dev, &dev_attr_name)))
660 goto exit_remove_files; 660 goto exit_remove_files;
661 661
662 data->class_dev = hwmon_device_register(&pdev->dev); 662 data->hwmon_dev = hwmon_device_register(&pdev->dev);
663 if (IS_ERR(data->class_dev)) { 663 if (IS_ERR(data->hwmon_dev)) {
664 err = PTR_ERR(data->class_dev); 664 err = PTR_ERR(data->hwmon_dev);
665 goto exit_remove_files; 665 goto exit_remove_files;
666 } 666 }
667 667
@@ -681,7 +681,7 @@ static int __devexit lm78_isa_remove(struct platform_device *pdev)
681{ 681{
682 struct lm78_data *data = platform_get_drvdata(pdev); 682 struct lm78_data *data = platform_get_drvdata(pdev);
683 683
684 hwmon_device_unregister(data->class_dev); 684 hwmon_device_unregister(data->hwmon_dev);
685 sysfs_remove_group(&pdev->dev.kobj, &lm78_group); 685 sysfs_remove_group(&pdev->dev.kobj, &lm78_group);
686 device_remove_file(&pdev->dev, &dev_attr_name); 686 device_remove_file(&pdev->dev, &dev_attr_name);
687 release_region(data->client.addr, LM78_EXTENT); 687 release_region(data->client.addr, LM78_EXTENT);
diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c
index 064516d824ad..063cdba00a88 100644
--- a/drivers/hwmon/lm80.c
+++ b/drivers/hwmon/lm80.c
@@ -108,7 +108,7 @@ static inline long TEMP_FROM_REG(u16 temp)
108 108
109struct lm80_data { 109struct lm80_data {
110 struct i2c_client client; 110 struct i2c_client client;
111 struct class_device *class_dev; 111 struct device *hwmon_dev;
112 struct mutex update_lock; 112 struct mutex update_lock;
113 char valid; /* !=0 if following fields are valid */ 113 char valid; /* !=0 if following fields are valid */
114 unsigned long last_updated; /* In jiffies */ 114 unsigned long last_updated; /* In jiffies */
@@ -497,9 +497,9 @@ static int lm80_detect(struct i2c_adapter *adapter, int address, int kind)
497 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm80_group))) 497 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm80_group)))
498 goto error_detach; 498 goto error_detach;
499 499
500 data->class_dev = hwmon_device_register(&new_client->dev); 500 data->hwmon_dev = hwmon_device_register(&new_client->dev);
501 if (IS_ERR(data->class_dev)) { 501 if (IS_ERR(data->hwmon_dev)) {
502 err = PTR_ERR(data->class_dev); 502 err = PTR_ERR(data->hwmon_dev);
503 goto error_remove; 503 goto error_remove;
504 } 504 }
505 505
@@ -520,7 +520,7 @@ static int lm80_detach_client(struct i2c_client *client)
520 struct lm80_data *data = i2c_get_clientdata(client); 520 struct lm80_data *data = i2c_get_clientdata(client);
521 int err; 521 int err;
522 522
523 hwmon_device_unregister(data->class_dev); 523 hwmon_device_unregister(data->hwmon_dev);
524 sysfs_remove_group(&client->dev.kobj, &lm80_group); 524 sysfs_remove_group(&client->dev.kobj, &lm80_group);
525 if ((err = i2c_detach_client(client))) 525 if ((err = i2c_detach_client(client)))
526 return err; 526 return err;
diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c
index 654c0f73464d..0336b4572a61 100644
--- a/drivers/hwmon/lm83.c
+++ b/drivers/hwmon/lm83.c
@@ -144,7 +144,7 @@ static struct i2c_driver lm83_driver = {
144 144
145struct lm83_data { 145struct lm83_data {
146 struct i2c_client client; 146 struct i2c_client client;
147 struct class_device *class_dev; 147 struct device *hwmon_dev;
148 struct mutex update_lock; 148 struct mutex update_lock;
149 char valid; /* zero until following fields are valid */ 149 char valid; /* zero until following fields are valid */
150 unsigned long last_updated; /* in jiffies */ 150 unsigned long last_updated; /* in jiffies */
@@ -400,9 +400,9 @@ static int lm83_detect(struct i2c_adapter *adapter, int address, int kind)
400 goto exit_remove_files; 400 goto exit_remove_files;
401 } 401 }
402 402
403 data->class_dev = hwmon_device_register(&new_client->dev); 403 data->hwmon_dev = hwmon_device_register(&new_client->dev);
404 if (IS_ERR(data->class_dev)) { 404 if (IS_ERR(data->hwmon_dev)) {
405 err = PTR_ERR(data->class_dev); 405 err = PTR_ERR(data->hwmon_dev);
406 goto exit_remove_files; 406 goto exit_remove_files;
407 } 407 }
408 408
@@ -424,7 +424,7 @@ static int lm83_detach_client(struct i2c_client *client)
424 struct lm83_data *data = i2c_get_clientdata(client); 424 struct lm83_data *data = i2c_get_clientdata(client);
425 int err; 425 int err;
426 426
427 hwmon_device_unregister(data->class_dev); 427 hwmon_device_unregister(data->hwmon_dev);
428 sysfs_remove_group(&client->dev.kobj, &lm83_group); 428 sysfs_remove_group(&client->dev.kobj, &lm83_group);
429 sysfs_remove_group(&client->dev.kobj, &lm83_group_opt); 429 sysfs_remove_group(&client->dev.kobj, &lm83_group_opt);
430 430
diff --git a/drivers/hwmon/lm85.c b/drivers/hwmon/lm85.c
index 20a8c648280d..954c364f38b4 100644
--- a/drivers/hwmon/lm85.c
+++ b/drivers/hwmon/lm85.c
@@ -328,7 +328,7 @@ struct lm85_autofan {
328 The structure is dynamically allocated. */ 328 The structure is dynamically allocated. */
329struct lm85_data { 329struct lm85_data {
330 struct i2c_client client; 330 struct i2c_client client;
331 struct class_device *class_dev; 331 struct device *hwmon_dev;
332 enum chips type; 332 enum chips type;
333 333
334 struct mutex update_lock; 334 struct mutex update_lock;
@@ -1257,9 +1257,9 @@ static int lm85_detect(struct i2c_adapter *adapter, int address,
1257 &dev_attr_in4_max))) 1257 &dev_attr_in4_max)))
1258 goto ERROR3; 1258 goto ERROR3;
1259 1259
1260 data->class_dev = hwmon_device_register(&new_client->dev); 1260 data->hwmon_dev = hwmon_device_register(&new_client->dev);
1261 if (IS_ERR(data->class_dev)) { 1261 if (IS_ERR(data->hwmon_dev)) {
1262 err = PTR_ERR(data->class_dev); 1262 err = PTR_ERR(data->hwmon_dev);
1263 goto ERROR3; 1263 goto ERROR3;
1264 } 1264 }
1265 1265
@@ -1280,7 +1280,7 @@ static int lm85_detect(struct i2c_adapter *adapter, int address,
1280static int lm85_detach_client(struct i2c_client *client) 1280static int lm85_detach_client(struct i2c_client *client)
1281{ 1281{
1282 struct lm85_data *data = i2c_get_clientdata(client); 1282 struct lm85_data *data = i2c_get_clientdata(client);
1283 hwmon_device_unregister(data->class_dev); 1283 hwmon_device_unregister(data->hwmon_dev);
1284 sysfs_remove_group(&client->dev.kobj, &lm85_group); 1284 sysfs_remove_group(&client->dev.kobj, &lm85_group);
1285 sysfs_remove_group(&client->dev.kobj, &lm85_group_opt); 1285 sysfs_remove_group(&client->dev.kobj, &lm85_group_opt);
1286 i2c_detach_client(client); 1286 i2c_detach_client(client);
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index 988ae1c4aada..e60076e8b597 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -176,7 +176,7 @@ static struct i2c_driver lm87_driver = {
176 176
177struct lm87_data { 177struct lm87_data {
178 struct i2c_client client; 178 struct i2c_client client;
179 struct class_device *class_dev; 179 struct device *hwmon_dev;
180 struct mutex update_lock; 180 struct mutex update_lock;
181 char valid; /* zero until following fields are valid */ 181 char valid; /* zero until following fields are valid */
182 unsigned long last_updated; /* In jiffies */ 182 unsigned long last_updated; /* In jiffies */
@@ -755,9 +755,9 @@ static int lm87_detect(struct i2c_adapter *adapter, int address, int kind)
755 goto exit_remove; 755 goto exit_remove;
756 } 756 }
757 757
758 data->class_dev = hwmon_device_register(&new_client->dev); 758 data->hwmon_dev = hwmon_device_register(&new_client->dev);
759 if (IS_ERR(data->class_dev)) { 759 if (IS_ERR(data->hwmon_dev)) {
760 err = PTR_ERR(data->class_dev); 760 err = PTR_ERR(data->hwmon_dev);
761 goto exit_remove; 761 goto exit_remove;
762 } 762 }
763 763
@@ -816,7 +816,7 @@ static int lm87_detach_client(struct i2c_client *client)
816 struct lm87_data *data = i2c_get_clientdata(client); 816 struct lm87_data *data = i2c_get_clientdata(client);
817 int err; 817 int err;
818 818
819 hwmon_device_unregister(data->class_dev); 819 hwmon_device_unregister(data->hwmon_dev);
820 sysfs_remove_group(&client->dev.kobj, &lm87_group); 820 sysfs_remove_group(&client->dev.kobj, &lm87_group);
821 sysfs_remove_group(&client->dev.kobj, &lm87_group_opt); 821 sysfs_remove_group(&client->dev.kobj, &lm87_group_opt);
822 822
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index af541d67245d..98b53b119c2a 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -214,7 +214,7 @@ static struct i2c_driver lm90_driver = {
214 214
215struct lm90_data { 215struct lm90_data {
216 struct i2c_client client; 216 struct i2c_client client;
217 struct class_device *class_dev; 217 struct device *hwmon_dev;
218 struct mutex update_lock; 218 struct mutex update_lock;
219 char valid; /* zero until following fields are valid */ 219 char valid; /* zero until following fields are valid */
220 unsigned long last_updated; /* in jiffies */ 220 unsigned long last_updated; /* in jiffies */
@@ -653,9 +653,9 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
653 goto exit_remove_files; 653 goto exit_remove_files;
654 } 654 }
655 655
656 data->class_dev = hwmon_device_register(&new_client->dev); 656 data->hwmon_dev = hwmon_device_register(&new_client->dev);
657 if (IS_ERR(data->class_dev)) { 657 if (IS_ERR(data->hwmon_dev)) {
658 err = PTR_ERR(data->class_dev); 658 err = PTR_ERR(data->hwmon_dev);
659 goto exit_remove_files; 659 goto exit_remove_files;
660 } 660 }
661 661
@@ -707,7 +707,7 @@ static int lm90_detach_client(struct i2c_client *client)
707 struct lm90_data *data = i2c_get_clientdata(client); 707 struct lm90_data *data = i2c_get_clientdata(client);
708 int err; 708 int err;
709 709
710 hwmon_device_unregister(data->class_dev); 710 hwmon_device_unregister(data->hwmon_dev);
711 sysfs_remove_group(&client->dev.kobj, &lm90_group); 711 sysfs_remove_group(&client->dev.kobj, &lm90_group);
712 device_remove_file(&client->dev, &dev_attr_pec); 712 device_remove_file(&client->dev, &dev_attr_pec);
713 713
diff --git a/drivers/hwmon/lm92.c b/drivers/hwmon/lm92.c
index 30b536333f14..61d1bd1d5b6e 100644
--- a/drivers/hwmon/lm92.c
+++ b/drivers/hwmon/lm92.c
@@ -96,7 +96,7 @@ static struct i2c_driver lm92_driver;
96/* Client data (each client gets its own) */ 96/* Client data (each client gets its own) */
97struct lm92_data { 97struct lm92_data {
98 struct i2c_client client; 98 struct i2c_client client;
99 struct class_device *class_dev; 99 struct device *hwmon_dev;
100 struct mutex update_lock; 100 struct mutex update_lock;
101 char valid; /* zero until following fields are valid */ 101 char valid; /* zero until following fields are valid */
102 unsigned long last_updated; /* in jiffies */ 102 unsigned long last_updated; /* in jiffies */
@@ -379,9 +379,9 @@ static int lm92_detect(struct i2c_adapter *adapter, int address, int kind)
379 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm92_group))) 379 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm92_group)))
380 goto exit_detach; 380 goto exit_detach;
381 381
382 data->class_dev = hwmon_device_register(&new_client->dev); 382 data->hwmon_dev = hwmon_device_register(&new_client->dev);
383 if (IS_ERR(data->class_dev)) { 383 if (IS_ERR(data->hwmon_dev)) {
384 err = PTR_ERR(data->class_dev); 384 err = PTR_ERR(data->hwmon_dev);
385 goto exit_remove; 385 goto exit_remove;
386 } 386 }
387 387
@@ -409,7 +409,7 @@ static int lm92_detach_client(struct i2c_client *client)
409 struct lm92_data *data = i2c_get_clientdata(client); 409 struct lm92_data *data = i2c_get_clientdata(client);
410 int err; 410 int err;
411 411
412 hwmon_device_unregister(data->class_dev); 412 hwmon_device_unregister(data->hwmon_dev);
413 sysfs_remove_group(&client->dev.kobj, &lm92_group); 413 sysfs_remove_group(&client->dev.kobj, &lm92_group);
414 414
415 if ((err = i2c_detach_client(client))) 415 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c
index 86c6c6ea0745..b9899b93c25e 100644
--- a/drivers/hwmon/lm93.c
+++ b/drivers/hwmon/lm93.c
@@ -201,7 +201,7 @@ struct block1_t {
201 */ 201 */
202struct lm93_data { 202struct lm93_data {
203 struct i2c_client client; 203 struct i2c_client client;
204 struct class_device *class_dev; 204 struct device *hwmon_dev;
205 205
206 struct mutex update_lock; 206 struct mutex update_lock;
207 unsigned long last_updated; /* In jiffies */ 207 unsigned long last_updated; /* In jiffies */
@@ -2590,11 +2590,11 @@ static int lm93_detect(struct i2c_adapter *adapter, int address, int kind)
2590 goto err_detach; 2590 goto err_detach;
2591 2591
2592 /* Register hwmon driver class */ 2592 /* Register hwmon driver class */
2593 data->class_dev = hwmon_device_register(&client->dev); 2593 data->hwmon_dev = hwmon_device_register(&client->dev);
2594 if ( !IS_ERR(data->class_dev)) 2594 if ( !IS_ERR(data->hwmon_dev))
2595 return 0; 2595 return 0;
2596 2596
2597 err = PTR_ERR(data->class_dev); 2597 err = PTR_ERR(data->hwmon_dev);
2598 dev_err(&client->dev, "error registering hwmon device.\n"); 2598 dev_err(&client->dev, "error registering hwmon device.\n");
2599 sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp); 2599 sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp);
2600err_detach: 2600err_detach:
@@ -2619,7 +2619,7 @@ static int lm93_detach_client(struct i2c_client *client)
2619 struct lm93_data *data = i2c_get_clientdata(client); 2619 struct lm93_data *data = i2c_get_clientdata(client);
2620 int err = 0; 2620 int err = 0;
2621 2621
2622 hwmon_device_unregister(data->class_dev); 2622 hwmon_device_unregister(data->hwmon_dev);
2623 sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp); 2623 sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp);
2624 2624
2625 err = i2c_detach_client(client); 2625 err = i2c_detach_client(client);
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c
index 2f58f651f03a..38a44c3d6cee 100644
--- a/drivers/hwmon/max1619.c
+++ b/drivers/hwmon/max1619.c
@@ -105,7 +105,7 @@ static struct i2c_driver max1619_driver = {
105 105
106struct max1619_data { 106struct max1619_data {
107 struct i2c_client client; 107 struct i2c_client client;
108 struct class_device *class_dev; 108 struct device *hwmon_dev;
109 struct mutex update_lock; 109 struct mutex update_lock;
110 char valid; /* zero until following fields are valid */ 110 char valid; /* zero until following fields are valid */
111 unsigned long last_updated; /* in jiffies */ 111 unsigned long last_updated; /* in jiffies */
@@ -293,9 +293,9 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind)
293 if ((err = sysfs_create_group(&new_client->dev.kobj, &max1619_group))) 293 if ((err = sysfs_create_group(&new_client->dev.kobj, &max1619_group)))
294 goto exit_detach; 294 goto exit_detach;
295 295
296 data->class_dev = hwmon_device_register(&new_client->dev); 296 data->hwmon_dev = hwmon_device_register(&new_client->dev);
297 if (IS_ERR(data->class_dev)) { 297 if (IS_ERR(data->hwmon_dev)) {
298 err = PTR_ERR(data->class_dev); 298 err = PTR_ERR(data->hwmon_dev);
299 goto exit_remove_files; 299 goto exit_remove_files;
300 } 300 }
301 301
@@ -331,7 +331,7 @@ static int max1619_detach_client(struct i2c_client *client)
331 struct max1619_data *data = i2c_get_clientdata(client); 331 struct max1619_data *data = i2c_get_clientdata(client);
332 int err; 332 int err;
333 333
334 hwmon_device_unregister(data->class_dev); 334 hwmon_device_unregister(data->hwmon_dev);
335 sysfs_remove_group(&client->dev.kobj, &max1619_group); 335 sysfs_remove_group(&client->dev.kobj, &max1619_group);
336 336
337 if ((err = i2c_detach_client(client))) 337 if ((err = i2c_detach_client(client)))
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
index 8415664f33c2..755570c1f4eb 100644
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -128,7 +128,7 @@ static struct i2c_driver max6650_driver = {
128struct max6650_data 128struct max6650_data
129{ 129{
130 struct i2c_client client; 130 struct i2c_client client;
131 struct class_device *class_dev; 131 struct device *hwmon_dev;
132 struct mutex update_lock; 132 struct mutex update_lock;
133 char valid; /* zero until following fields are valid */ 133 char valid; /* zero until following fields are valid */
134 unsigned long last_updated; /* in jiffies */ 134 unsigned long last_updated; /* in jiffies */
@@ -523,11 +523,11 @@ static int max6650_detect(struct i2c_adapter *adapter, int address, int kind)
523 if (err) 523 if (err)
524 goto err_detach; 524 goto err_detach;
525 525
526 data->class_dev = hwmon_device_register(&client->dev); 526 data->hwmon_dev = hwmon_device_register(&client->dev);
527 if (!IS_ERR(data->class_dev)) 527 if (!IS_ERR(data->hwmon_dev))
528 return 0; 528 return 0;
529 529
530 err = PTR_ERR(data->class_dev); 530 err = PTR_ERR(data->hwmon_dev);
531 dev_err(&client->dev, "error registering hwmon device.\n"); 531 dev_err(&client->dev, "error registering hwmon device.\n");
532 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp); 532 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp);
533err_detach: 533err_detach:
@@ -543,7 +543,7 @@ static int max6650_detach_client(struct i2c_client *client)
543 int err; 543 int err;
544 544
545 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp); 545 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp);
546 hwmon_device_unregister(data->class_dev); 546 hwmon_device_unregister(data->hwmon_dev);
547 err = i2c_detach_client(client); 547 err = i2c_detach_client(client);
548 if (!err) 548 if (!err)
549 kfree(data); 549 kfree(data);
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
index f57c75d59a5b..91cf51034b56 100644
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -180,7 +180,7 @@ static inline u8 PWM_TO_REG(int val, int inv)
180 180
181struct pc87360_data { 181struct pc87360_data {
182 const char *name; 182 const char *name;
183 struct class_device *class_dev; 183 struct device *hwmon_dev;
184 struct mutex lock; 184 struct mutex lock;
185 struct mutex update_lock; 185 struct mutex update_lock;
186 char valid; /* !=0 if following fields are valid */ 186 char valid; /* !=0 if following fields are valid */
@@ -1054,9 +1054,9 @@ static int __devinit pc87360_probe(struct platform_device *pdev)
1054 if ((err = device_create_file(dev, &dev_attr_name))) 1054 if ((err = device_create_file(dev, &dev_attr_name)))
1055 goto ERROR3; 1055 goto ERROR3;
1056 1056
1057 data->class_dev = hwmon_device_register(dev); 1057 data->hwmon_dev = hwmon_device_register(dev);
1058 if (IS_ERR(data->class_dev)) { 1058 if (IS_ERR(data->hwmon_dev)) {
1059 err = PTR_ERR(data->class_dev); 1059 err = PTR_ERR(data->hwmon_dev);
1060 goto ERROR3; 1060 goto ERROR3;
1061 } 1061 }
1062 return 0; 1062 return 0;
@@ -1083,7 +1083,7 @@ static int __devexit pc87360_remove(struct platform_device *pdev)
1083 struct pc87360_data *data = platform_get_drvdata(pdev); 1083 struct pc87360_data *data = platform_get_drvdata(pdev);
1084 int i; 1084 int i;
1085 1085
1086 hwmon_device_unregister(data->class_dev); 1086 hwmon_device_unregister(data->hwmon_dev);
1087 1087
1088 device_remove_file(&pdev->dev, &dev_attr_name); 1088 device_remove_file(&pdev->dev, &dev_attr_name);
1089 sysfs_remove_group(&pdev->dev.kobj, &pc8736x_temp_group); 1089 sysfs_remove_group(&pdev->dev.kobj, &pc8736x_temp_group);
diff --git a/drivers/hwmon/pc87427.c b/drivers/hwmon/pc87427.c
index 2915bc4ad0d5..d40509ad6ae6 100644
--- a/drivers/hwmon/pc87427.c
+++ b/drivers/hwmon/pc87427.c
@@ -42,7 +42,7 @@ static struct platform_device *pdev;
42 device is using banked registers) and the register cache (needed to keep 42 device is using banked registers) and the register cache (needed to keep
43 the data in the registers and the cache in sync at any time). */ 43 the data in the registers and the cache in sync at any time). */
44struct pc87427_data { 44struct pc87427_data {
45 struct class_device *class_dev; 45 struct device *hwmon_dev;
46 struct mutex lock; 46 struct mutex lock;
47 int address[2]; 47 int address[2];
48 const char *name; 48 const char *name;
@@ -454,9 +454,9 @@ static int __devinit pc87427_probe(struct platform_device *pdev)
454 goto exit_remove_files; 454 goto exit_remove_files;
455 } 455 }
456 456
457 data->class_dev = hwmon_device_register(&pdev->dev); 457 data->hwmon_dev = hwmon_device_register(&pdev->dev);
458 if (IS_ERR(data->class_dev)) { 458 if (IS_ERR(data->hwmon_dev)) {
459 err = PTR_ERR(data->class_dev); 459 err = PTR_ERR(data->hwmon_dev);
460 dev_err(&pdev->dev, "Class registration failed (%d)\n", err); 460 dev_err(&pdev->dev, "Class registration failed (%d)\n", err);
461 goto exit_remove_files; 461 goto exit_remove_files;
462 } 462 }
@@ -484,7 +484,7 @@ static int __devexit pc87427_remove(struct platform_device *pdev)
484 struct resource *res; 484 struct resource *res;
485 int i; 485 int i;
486 486
487 hwmon_device_unregister(data->class_dev); 487 hwmon_device_unregister(data->hwmon_dev);
488 device_remove_file(&pdev->dev, &dev_attr_name); 488 device_remove_file(&pdev->dev, &dev_attr_name);
489 for (i = 0; i < 8; i++) { 489 for (i = 0; i < 8; i++) {
490 if (!(data->fan_enabled & (1 << i))) 490 if (!(data->fan_enabled & (1 << i)))
diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c
index 92956eb3f3c1..3de9721aa67f 100644
--- a/drivers/hwmon/sis5595.c
+++ b/drivers/hwmon/sis5595.c
@@ -163,7 +163,7 @@ static inline u8 DIV_TO_REG(int val)
163struct sis5595_data { 163struct sis5595_data {
164 unsigned short addr; 164 unsigned short addr;
165 const char *name; 165 const char *name;
166 struct class_device *class_dev; 166 struct device *hwmon_dev;
167 struct mutex lock; 167 struct mutex lock;
168 168
169 struct mutex update_lock; 169 struct mutex update_lock;
@@ -557,9 +557,9 @@ static int __devinit sis5595_probe(struct platform_device *pdev)
557 goto exit_remove_files; 557 goto exit_remove_files;
558 } 558 }
559 559
560 data->class_dev = hwmon_device_register(&pdev->dev); 560 data->hwmon_dev = hwmon_device_register(&pdev->dev);
561 if (IS_ERR(data->class_dev)) { 561 if (IS_ERR(data->hwmon_dev)) {
562 err = PTR_ERR(data->class_dev); 562 err = PTR_ERR(data->hwmon_dev);
563 goto exit_remove_files; 563 goto exit_remove_files;
564 } 564 }
565 565
@@ -580,7 +580,7 @@ static int __devexit sis5595_remove(struct platform_device *pdev)
580{ 580{
581 struct sis5595_data *data = platform_get_drvdata(pdev); 581 struct sis5595_data *data = platform_get_drvdata(pdev);
582 582
583 hwmon_device_unregister(data->class_dev); 583 hwmon_device_unregister(data->hwmon_dev);
584 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group); 584 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group);
585 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt); 585 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt);
586 586
diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c
index 45266b30ce1d..0b57d2ea2cf7 100644
--- a/drivers/hwmon/smsc47b397.c
+++ b/drivers/hwmon/smsc47b397.c
@@ -94,7 +94,7 @@ static u8 smsc47b397_reg_temp[] = {0x25, 0x26, 0x27, 0x80};
94struct smsc47b397_data { 94struct smsc47b397_data {
95 unsigned short addr; 95 unsigned short addr;
96 const char *name; 96 const char *name;
97 struct class_device *class_dev; 97 struct device *hwmon_dev;
98 struct mutex lock; 98 struct mutex lock;
99 99
100 struct mutex update_lock; 100 struct mutex update_lock;
@@ -222,7 +222,7 @@ static int __devexit smsc47b397_remove(struct platform_device *pdev)
222 struct smsc47b397_data *data = platform_get_drvdata(pdev); 222 struct smsc47b397_data *data = platform_get_drvdata(pdev);
223 struct resource *res; 223 struct resource *res;
224 224
225 hwmon_device_unregister(data->class_dev); 225 hwmon_device_unregister(data->hwmon_dev);
226 sysfs_remove_group(&pdev->dev.kobj, &smsc47b397_group); 226 sysfs_remove_group(&pdev->dev.kobj, &smsc47b397_group);
227 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 227 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
228 release_region(res->start, SMSC_EXTENT); 228 release_region(res->start, SMSC_EXTENT);
@@ -272,9 +272,9 @@ static int __devinit smsc47b397_probe(struct platform_device *pdev)
272 if ((err = sysfs_create_group(&dev->kobj, &smsc47b397_group))) 272 if ((err = sysfs_create_group(&dev->kobj, &smsc47b397_group)))
273 goto error_free; 273 goto error_free;
274 274
275 data->class_dev = hwmon_device_register(dev); 275 data->hwmon_dev = hwmon_device_register(dev);
276 if (IS_ERR(data->class_dev)) { 276 if (IS_ERR(data->hwmon_dev)) {
277 err = PTR_ERR(data->class_dev); 277 err = PTR_ERR(data->hwmon_dev);
278 goto error_remove; 278 goto error_remove;
279 } 279 }
280 280
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
index 71792778d6f2..a10a380868e2 100644
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -116,7 +116,7 @@ struct smsc47m1_data {
116 unsigned short addr; 116 unsigned short addr;
117 const char *name; 117 const char *name;
118 enum chips type; 118 enum chips type;
119 struct class_device *class_dev; 119 struct device *hwmon_dev;
120 120
121 struct mutex update_lock; 121 struct mutex update_lock;
122 unsigned long last_updated; /* In jiffies */ 122 unsigned long last_updated; /* In jiffies */
@@ -588,9 +588,9 @@ static int __devinit smsc47m1_probe(struct platform_device *pdev)
588 if ((err = device_create_file(dev, &dev_attr_name))) 588 if ((err = device_create_file(dev, &dev_attr_name)))
589 goto error_remove_files; 589 goto error_remove_files;
590 590
591 data->class_dev = hwmon_device_register(dev); 591 data->hwmon_dev = hwmon_device_register(dev);
592 if (IS_ERR(data->class_dev)) { 592 if (IS_ERR(data->hwmon_dev)) {
593 err = PTR_ERR(data->class_dev); 593 err = PTR_ERR(data->hwmon_dev);
594 goto error_remove_files; 594 goto error_remove_files;
595 } 595 }
596 596
@@ -611,7 +611,7 @@ static int __devexit smsc47m1_remove(struct platform_device *pdev)
611 struct smsc47m1_data *data = platform_get_drvdata(pdev); 611 struct smsc47m1_data *data = platform_get_drvdata(pdev);
612 struct resource *res; 612 struct resource *res;
613 613
614 hwmon_device_unregister(data->class_dev); 614 hwmon_device_unregister(data->hwmon_dev);
615 sysfs_remove_group(&pdev->dev.kobj, &smsc47m1_group); 615 sysfs_remove_group(&pdev->dev.kobj, &smsc47m1_group);
616 616
617 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 617 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c
index d3a3ba04cb0f..0efcd27b2523 100644
--- a/drivers/hwmon/smsc47m192.c
+++ b/drivers/hwmon/smsc47m192.c
@@ -97,7 +97,7 @@ static inline int TEMP_FROM_REG(s8 val)
97 97
98struct smsc47m192_data { 98struct smsc47m192_data {
99 struct i2c_client client; 99 struct i2c_client client;
100 struct class_device *class_dev; 100 struct device *hwmon_dev;
101 struct mutex update_lock; 101 struct mutex update_lock;
102 char valid; /* !=0 if following fields are valid */ 102 char valid; /* !=0 if following fields are valid */
103 unsigned long last_updated; /* In jiffies */ 103 unsigned long last_updated; /* In jiffies */
@@ -553,9 +553,9 @@ static int smsc47m192_detect(struct i2c_adapter *adapter, int address,
553 goto exit_remove_files; 553 goto exit_remove_files;
554 } 554 }
555 555
556 data->class_dev = hwmon_device_register(&client->dev); 556 data->hwmon_dev = hwmon_device_register(&client->dev);
557 if (IS_ERR(data->class_dev)) { 557 if (IS_ERR(data->hwmon_dev)) {
558 err = PTR_ERR(data->class_dev); 558 err = PTR_ERR(data->hwmon_dev);
559 goto exit_remove_files; 559 goto exit_remove_files;
560 } 560 }
561 561
@@ -577,7 +577,7 @@ static int smsc47m192_detach_client(struct i2c_client *client)
577 struct smsc47m192_data *data = i2c_get_clientdata(client); 577 struct smsc47m192_data *data = i2c_get_clientdata(client);
578 int err; 578 int err;
579 579
580 hwmon_device_unregister(data->class_dev); 580 hwmon_device_unregister(data->hwmon_dev);
581 sysfs_remove_group(&client->dev.kobj, &smsc47m192_group); 581 sysfs_remove_group(&client->dev.kobj, &smsc47m192_group);
582 sysfs_remove_group(&client->dev.kobj, &smsc47m192_group_in4); 582 sysfs_remove_group(&client->dev.kobj, &smsc47m192_group_in4);
583 583
diff --git a/drivers/hwmon/thmc50.c b/drivers/hwmon/thmc50.c
index c920f394a5c2..981d1f1dc61f 100644
--- a/drivers/hwmon/thmc50.c
+++ b/drivers/hwmon/thmc50.c
@@ -61,7 +61,7 @@ const static u8 THMC50_REG_TEMP_MAX[] = { 0x39, 0x37, 0x2B };
61/* Each client has this additional data */ 61/* Each client has this additional data */
62struct thmc50_data { 62struct thmc50_data {
63 struct i2c_client client; 63 struct i2c_client client;
64 struct class_device *class_dev; 64 struct device *hwmon_dev;
65 65
66 struct mutex update_lock; 66 struct mutex update_lock;
67 enum chips type; 67 enum chips type;
@@ -351,9 +351,9 @@ static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind)
351 goto exit_remove_sysfs_thmc50; 351 goto exit_remove_sysfs_thmc50;
352 352
353 /* Register a new directory entry with module sensors */ 353 /* Register a new directory entry with module sensors */
354 data->class_dev = hwmon_device_register(&client->dev); 354 data->hwmon_dev = hwmon_device_register(&client->dev);
355 if (IS_ERR(data->class_dev)) { 355 if (IS_ERR(data->hwmon_dev)) {
356 err = PTR_ERR(data->class_dev); 356 err = PTR_ERR(data->hwmon_dev);
357 goto exit_remove_sysfs; 357 goto exit_remove_sysfs;
358 } 358 }
359 359
@@ -384,7 +384,7 @@ static int thmc50_detach_client(struct i2c_client *client)
384 struct thmc50_data *data = i2c_get_clientdata(client); 384 struct thmc50_data *data = i2c_get_clientdata(client);
385 int err; 385 int err;
386 386
387 hwmon_device_unregister(data->class_dev); 387 hwmon_device_unregister(data->hwmon_dev);
388 sysfs_remove_group(&client->dev.kobj, &thmc50_group); 388 sysfs_remove_group(&client->dev.kobj, &thmc50_group);
389 if (data->type == adm1022) 389 if (data->type == adm1022)
390 sysfs_remove_group(&client->dev.kobj, &adm1022_group); 390 sysfs_remove_group(&client->dev.kobj, &adm1022_group);
diff --git a/drivers/hwmon/via686a.c b/drivers/hwmon/via686a.c
index 696c8a2e5374..8f63dada6019 100644
--- a/drivers/hwmon/via686a.c
+++ b/drivers/hwmon/via686a.c
@@ -294,7 +294,7 @@ static inline long TEMP_FROM_REG10(u16 val)
294struct via686a_data { 294struct via686a_data {
295 unsigned short addr; 295 unsigned short addr;
296 const char *name; 296 const char *name;
297 struct class_device *class_dev; 297 struct device *hwmon_dev;
298 struct mutex update_lock; 298 struct mutex update_lock;
299 char valid; /* !=0 if following fields are valid */ 299 char valid; /* !=0 if following fields are valid */
300 unsigned long last_updated; /* In jiffies */ 300 unsigned long last_updated; /* In jiffies */
@@ -627,9 +627,9 @@ static int __devinit via686a_probe(struct platform_device *pdev)
627 if ((err = sysfs_create_group(&pdev->dev.kobj, &via686a_group))) 627 if ((err = sysfs_create_group(&pdev->dev.kobj, &via686a_group)))
628 goto exit_free; 628 goto exit_free;
629 629
630 data->class_dev = hwmon_device_register(&pdev->dev); 630 data->hwmon_dev = hwmon_device_register(&pdev->dev);
631 if (IS_ERR(data->class_dev)) { 631 if (IS_ERR(data->hwmon_dev)) {
632 err = PTR_ERR(data->class_dev); 632 err = PTR_ERR(data->hwmon_dev);
633 goto exit_remove_files; 633 goto exit_remove_files;
634 } 634 }
635 635
@@ -648,7 +648,7 @@ static int __devexit via686a_remove(struct platform_device *pdev)
648{ 648{
649 struct via686a_data *data = platform_get_drvdata(pdev); 649 struct via686a_data *data = platform_get_drvdata(pdev);
650 650
651 hwmon_device_unregister(data->class_dev); 651 hwmon_device_unregister(data->hwmon_dev);
652 sysfs_remove_group(&pdev->dev.kobj, &via686a_group); 652 sysfs_remove_group(&pdev->dev.kobj, &via686a_group);
653 653
654 release_region(data->addr, VIA686A_EXTENT); 654 release_region(data->addr, VIA686A_EXTENT);
diff --git a/drivers/hwmon/vt1211.c b/drivers/hwmon/vt1211.c
index 9f3e332c5b7f..e69416465e6d 100644
--- a/drivers/hwmon/vt1211.c
+++ b/drivers/hwmon/vt1211.c
@@ -108,7 +108,7 @@ static const u8 bitalarmfan[] = {6, 7};
108struct vt1211_data { 108struct vt1211_data {
109 unsigned short addr; 109 unsigned short addr;
110 const char *name; 110 const char *name;
111 struct class_device *class_dev; 111 struct device *hwmon_dev;
112 112
113 struct mutex update_lock; 113 struct mutex update_lock;
114 char valid; /* !=0 if following fields are valid */ 114 char valid; /* !=0 if following fields are valid */
@@ -1191,9 +1191,9 @@ static int __devinit vt1211_probe(struct platform_device *pdev)
1191 } 1191 }
1192 1192
1193 /* Register device */ 1193 /* Register device */
1194 data->class_dev = hwmon_device_register(dev); 1194 data->hwmon_dev = hwmon_device_register(dev);
1195 if (IS_ERR(data->class_dev)) { 1195 if (IS_ERR(data->hwmon_dev)) {
1196 err = PTR_ERR(data->class_dev); 1196 err = PTR_ERR(data->hwmon_dev);
1197 dev_err(dev, "Class registration failed (%d)\n", err); 1197 dev_err(dev, "Class registration failed (%d)\n", err);
1198 goto EXIT_DEV_REMOVE_SILENT; 1198 goto EXIT_DEV_REMOVE_SILENT;
1199 } 1199 }
@@ -1217,7 +1217,7 @@ static int __devexit vt1211_remove(struct platform_device *pdev)
1217 struct vt1211_data *data = platform_get_drvdata(pdev); 1217 struct vt1211_data *data = platform_get_drvdata(pdev);
1218 struct resource *res; 1218 struct resource *res;
1219 1219
1220 hwmon_device_unregister(data->class_dev); 1220 hwmon_device_unregister(data->hwmon_dev);
1221 vt1211_remove_sysfs(pdev); 1221 vt1211_remove_sysfs(pdev);
1222 platform_set_drvdata(pdev, NULL); 1222 platform_set_drvdata(pdev, NULL);
1223 kfree(data); 1223 kfree(data);
diff --git a/drivers/hwmon/vt8231.c b/drivers/hwmon/vt8231.c
index 3e63eaf19041..8806302b5f30 100644
--- a/drivers/hwmon/vt8231.c
+++ b/drivers/hwmon/vt8231.c
@@ -148,7 +148,7 @@ struct vt8231_data {
148 const char *name; 148 const char *name;
149 149
150 struct mutex update_lock; 150 struct mutex update_lock;
151 struct class_device *class_dev; 151 struct device *hwmon_dev;
152 char valid; /* !=0 if following fields are valid */ 152 char valid; /* !=0 if following fields are valid */
153 unsigned long last_updated; /* In jiffies */ 153 unsigned long last_updated; /* In jiffies */
154 154
@@ -726,9 +726,9 @@ int vt8231_probe(struct platform_device *pdev)
726 } 726 }
727 } 727 }
728 728
729 data->class_dev = hwmon_device_register(&pdev->dev); 729 data->hwmon_dev = hwmon_device_register(&pdev->dev);
730 if (IS_ERR(data->class_dev)) { 730 if (IS_ERR(data->hwmon_dev)) {
731 err = PTR_ERR(data->class_dev); 731 err = PTR_ERR(data->hwmon_dev);
732 goto exit_remove_files; 732 goto exit_remove_files;
733 } 733 }
734 return 0; 734 return 0;
@@ -756,7 +756,7 @@ static int __devexit vt8231_remove(struct platform_device *pdev)
756 struct vt8231_data *data = platform_get_drvdata(pdev); 756 struct vt8231_data *data = platform_get_drvdata(pdev);
757 int i; 757 int i;
758 758
759 hwmon_device_unregister(data->class_dev); 759 hwmon_device_unregister(data->hwmon_dev);
760 760
761 for (i = 0; i < ARRAY_SIZE(vt8231_group_volts); i++) 761 for (i = 0; i < ARRAY_SIZE(vt8231_group_volts); i++)
762 sysfs_remove_group(&pdev->dev.kobj, &vt8231_group_volts[i]); 762 sysfs_remove_group(&pdev->dev.kobj, &vt8231_group_volts[i]);
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index e3dfc52b5995..b15c6a998b72 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -256,7 +256,7 @@ struct w83627ehf_data {
256 int addr; /* IO base of hw monitor block */ 256 int addr; /* IO base of hw monitor block */
257 const char *name; 257 const char *name;
258 258
259 struct class_device *class_dev; 259 struct device *hwmon_dev;
260 struct mutex lock; 260 struct mutex lock;
261 261
262 struct mutex update_lock; 262 struct mutex update_lock;
@@ -1384,9 +1384,9 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
1384 goto exit_remove; 1384 goto exit_remove;
1385 } 1385 }
1386 1386
1387 data->class_dev = hwmon_device_register(dev); 1387 data->hwmon_dev = hwmon_device_register(dev);
1388 if (IS_ERR(data->class_dev)) { 1388 if (IS_ERR(data->hwmon_dev)) {
1389 err = PTR_ERR(data->class_dev); 1389 err = PTR_ERR(data->hwmon_dev);
1390 goto exit_remove; 1390 goto exit_remove;
1391 } 1391 }
1392 1392
@@ -1406,7 +1406,7 @@ static int __devexit w83627ehf_remove(struct platform_device *pdev)
1406{ 1406{
1407 struct w83627ehf_data *data = platform_get_drvdata(pdev); 1407 struct w83627ehf_data *data = platform_get_drvdata(pdev);
1408 1408
1409 hwmon_device_unregister(data->class_dev); 1409 hwmon_device_unregister(data->hwmon_dev);
1410 w83627ehf_device_remove_files(&pdev->dev); 1410 w83627ehf_device_remove_files(&pdev->dev);
1411 release_region(data->addr, IOREGION_LENGTH); 1411 release_region(data->addr, IOREGION_LENGTH);
1412 platform_set_drvdata(pdev, NULL); 1412 platform_set_drvdata(pdev, NULL);
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
index f0e0e208be9a..b1943ec29c48 100644
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -346,7 +346,7 @@ static inline u8 DIV_TO_REG(long val)
346struct w83627hf_data { 346struct w83627hf_data {
347 unsigned short addr; 347 unsigned short addr;
348 const char *name; 348 const char *name;
349 struct class_device *class_dev; 349 struct device *hwmon_dev;
350 struct mutex lock; 350 struct mutex lock;
351 enum chips type; 351 enum chips type;
352 352
@@ -1295,9 +1295,9 @@ static int __devinit w83627hf_probe(struct platform_device *pdev)
1295 || (err = device_create_file(dev, &dev_attr_pwm3_freq))) 1295 || (err = device_create_file(dev, &dev_attr_pwm3_freq)))
1296 goto ERROR4; 1296 goto ERROR4;
1297 1297
1298 data->class_dev = hwmon_device_register(dev); 1298 data->hwmon_dev = hwmon_device_register(dev);
1299 if (IS_ERR(data->class_dev)) { 1299 if (IS_ERR(data->hwmon_dev)) {
1300 err = PTR_ERR(data->class_dev); 1300 err = PTR_ERR(data->hwmon_dev);
1301 goto ERROR4; 1301 goto ERROR4;
1302 } 1302 }
1303 1303
@@ -1320,7 +1320,7 @@ static int __devexit w83627hf_remove(struct platform_device *pdev)
1320 struct w83627hf_data *data = platform_get_drvdata(pdev); 1320 struct w83627hf_data *data = platform_get_drvdata(pdev);
1321 struct resource *res; 1321 struct resource *res;
1322 1322
1323 hwmon_device_unregister(data->class_dev); 1323 hwmon_device_unregister(data->hwmon_dev);
1324 1324
1325 sysfs_remove_group(&pdev->dev.kobj, &w83627hf_group); 1325 sysfs_remove_group(&pdev->dev.kobj, &w83627hf_group);
1326 sysfs_remove_group(&pdev->dev.kobj, &w83627hf_group_opt); 1326 sysfs_remove_group(&pdev->dev.kobj, &w83627hf_group_opt);
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index c12bdf9d9e1d..e622ec5b092e 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -220,7 +220,7 @@ DIV_TO_REG(long val, enum chips type)
220 the driver field to differentiate between I2C and ISA chips. */ 220 the driver field to differentiate between I2C and ISA chips. */
221struct w83781d_data { 221struct w83781d_data {
222 struct i2c_client client; 222 struct i2c_client client;
223 struct class_device *class_dev; 223 struct device *hwmon_dev;
224 struct mutex lock; 224 struct mutex lock;
225 enum chips type; 225 enum chips type;
226 226
@@ -1158,9 +1158,9 @@ w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
1158 if (err) 1158 if (err)
1159 goto ERROR4; 1159 goto ERROR4;
1160 1160
1161 data->class_dev = hwmon_device_register(dev); 1161 data->hwmon_dev = hwmon_device_register(dev);
1162 if (IS_ERR(data->class_dev)) { 1162 if (IS_ERR(data->hwmon_dev)) {
1163 err = PTR_ERR(data->class_dev); 1163 err = PTR_ERR(data->hwmon_dev);
1164 goto ERROR4; 1164 goto ERROR4;
1165 } 1165 }
1166 1166
@@ -1194,7 +1194,7 @@ w83781d_detach_client(struct i2c_client *client)
1194 1194
1195 /* main client */ 1195 /* main client */
1196 if (data) { 1196 if (data) {
1197 hwmon_device_unregister(data->class_dev); 1197 hwmon_device_unregister(data->hwmon_dev);
1198 sysfs_remove_group(&client->dev.kobj, &w83781d_group); 1198 sysfs_remove_group(&client->dev.kobj, &w83781d_group);
1199 sysfs_remove_group(&client->dev.kobj, &w83781d_group_opt); 1199 sysfs_remove_group(&client->dev.kobj, &w83781d_group_opt);
1200 } 1200 }
@@ -1261,9 +1261,9 @@ w83781d_isa_probe(struct platform_device *pdev)
1261 if (err) 1261 if (err)
1262 goto exit_remove_files; 1262 goto exit_remove_files;
1263 1263
1264 data->class_dev = hwmon_device_register(&pdev->dev); 1264 data->hwmon_dev = hwmon_device_register(&pdev->dev);
1265 if (IS_ERR(data->class_dev)) { 1265 if (IS_ERR(data->hwmon_dev)) {
1266 err = PTR_ERR(data->class_dev); 1266 err = PTR_ERR(data->hwmon_dev);
1267 goto exit_remove_files; 1267 goto exit_remove_files;
1268 } 1268 }
1269 1269
@@ -1285,7 +1285,7 @@ w83781d_isa_remove(struct platform_device *pdev)
1285{ 1285{
1286 struct w83781d_data *data = platform_get_drvdata(pdev); 1286 struct w83781d_data *data = platform_get_drvdata(pdev);
1287 1287
1288 hwmon_device_unregister(data->class_dev); 1288 hwmon_device_unregister(data->hwmon_dev);
1289 sysfs_remove_group(&pdev->dev.kobj, &w83781d_group); 1289 sysfs_remove_group(&pdev->dev.kobj, &w83781d_group);
1290 sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt); 1290 sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt);
1291 device_remove_file(&pdev->dev, &dev_attr_name); 1291 device_remove_file(&pdev->dev, &dev_attr_name);
diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c
index 9e5f885368b4..a3cb89455ea7 100644
--- a/drivers/hwmon/w83791d.c
+++ b/drivers/hwmon/w83791d.c
@@ -247,7 +247,7 @@ static u8 div_to_reg(int nr, long val)
247 247
248struct w83791d_data { 248struct w83791d_data {
249 struct i2c_client client; 249 struct i2c_client client;
250 struct class_device *class_dev; 250 struct device *hwmon_dev;
251 struct mutex update_lock; 251 struct mutex update_lock;
252 252
253 char valid; /* !=0 if following fields are valid */ 253 char valid; /* !=0 if following fields are valid */
@@ -1017,9 +1017,9 @@ static int w83791d_detect(struct i2c_adapter *adapter, int address, int kind)
1017 goto error3; 1017 goto error3;
1018 1018
1019 /* Everything is ready, now register the working device */ 1019 /* Everything is ready, now register the working device */
1020 data->class_dev = hwmon_device_register(dev); 1020 data->hwmon_dev = hwmon_device_register(dev);
1021 if (IS_ERR(data->class_dev)) { 1021 if (IS_ERR(data->hwmon_dev)) {
1022 err = PTR_ERR(data->class_dev); 1022 err = PTR_ERR(data->hwmon_dev);
1023 goto error4; 1023 goto error4;
1024 } 1024 }
1025 1025
@@ -1051,7 +1051,7 @@ static int w83791d_detach_client(struct i2c_client *client)
1051 1051
1052 /* main client */ 1052 /* main client */
1053 if (data) { 1053 if (data) {
1054 hwmon_device_unregister(data->class_dev); 1054 hwmon_device_unregister(data->hwmon_dev);
1055 sysfs_remove_group(&client->dev.kobj, &w83791d_group); 1055 sysfs_remove_group(&client->dev.kobj, &w83791d_group);
1056 } 1056 }
1057 1057
diff --git a/drivers/hwmon/w83792d.c b/drivers/hwmon/w83792d.c
index f6dee3800628..f836198b705c 100644
--- a/drivers/hwmon/w83792d.c
+++ b/drivers/hwmon/w83792d.c
@@ -267,7 +267,7 @@ DIV_TO_REG(long val)
267 267
268struct w83792d_data { 268struct w83792d_data {
269 struct i2c_client client; 269 struct i2c_client client;
270 struct class_device *class_dev; 270 struct device *hwmon_dev;
271 enum chips type; 271 enum chips type;
272 272
273 struct mutex update_lock; 273 struct mutex update_lock;
@@ -1443,9 +1443,9 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
1443 &w83792d_group_fan[3]))) 1443 &w83792d_group_fan[3])))
1444 goto exit_remove_files; 1444 goto exit_remove_files;
1445 1445
1446 data->class_dev = hwmon_device_register(dev); 1446 data->hwmon_dev = hwmon_device_register(dev);
1447 if (IS_ERR(data->class_dev)) { 1447 if (IS_ERR(data->hwmon_dev)) {
1448 err = PTR_ERR(data->class_dev); 1448 err = PTR_ERR(data->hwmon_dev);
1449 goto exit_remove_files; 1449 goto exit_remove_files;
1450 } 1450 }
1451 1451
@@ -1480,7 +1480,7 @@ w83792d_detach_client(struct i2c_client *client)
1480 1480
1481 /* main client */ 1481 /* main client */
1482 if (data) { 1482 if (data) {
1483 hwmon_device_unregister(data->class_dev); 1483 hwmon_device_unregister(data->hwmon_dev);
1484 sysfs_remove_group(&client->dev.kobj, &w83792d_group); 1484 sysfs_remove_group(&client->dev.kobj, &w83792d_group);
1485 for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++) 1485 for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++)
1486 sysfs_remove_group(&client->dev.kobj, 1486 sysfs_remove_group(&client->dev.kobj,
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index 253ffaf1568a..48599e1cc554 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -179,7 +179,7 @@ static inline s8 TEMP_TO_REG(long val, s8 min, s8 max)
179struct w83793_data { 179struct w83793_data {
180 struct i2c_client client; 180 struct i2c_client client;
181 struct i2c_client *lm75[2]; 181 struct i2c_client *lm75[2];
182 struct class_device *class_dev; 182 struct device *hwmon_dev;
183 struct mutex update_lock; 183 struct mutex update_lock;
184 char valid; /* !=0 if following fields are valid */ 184 char valid; /* !=0 if following fields are valid */
185 unsigned long last_updated; /* In jiffies */ 185 unsigned long last_updated; /* In jiffies */
@@ -1075,7 +1075,7 @@ static int w83793_detach_client(struct i2c_client *client)
1075 1075
1076 /* main client */ 1076 /* main client */
1077 if (data) { 1077 if (data) {
1078 hwmon_device_unregister(data->class_dev); 1078 hwmon_device_unregister(data->hwmon_dev);
1079 1079
1080 for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++) 1080 for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++)
1081 device_remove_file(dev, 1081 device_remove_file(dev,
@@ -1434,9 +1434,9 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind)
1434 } 1434 }
1435 } 1435 }
1436 1436
1437 data->class_dev = hwmon_device_register(dev); 1437 data->hwmon_dev = hwmon_device_register(dev);
1438 if (IS_ERR(data->class_dev)) { 1438 if (IS_ERR(data->hwmon_dev)) {
1439 err = PTR_ERR(data->class_dev); 1439 err = PTR_ERR(data->hwmon_dev);
1440 goto exit_remove; 1440 goto exit_remove;
1441 } 1441 }
1442 1442
diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c
index a3fcace412f0..b5db354e2f19 100644
--- a/drivers/hwmon/w83l785ts.c
+++ b/drivers/hwmon/w83l785ts.c
@@ -107,7 +107,7 @@ static struct i2c_driver w83l785ts_driver = {
107 107
108struct w83l785ts_data { 108struct w83l785ts_data {
109 struct i2c_client client; 109 struct i2c_client client;
110 struct class_device *class_dev; 110 struct device *hwmon_dev;
111 struct mutex update_lock; 111 struct mutex update_lock;
112 char valid; /* zero until following fields are valid */ 112 char valid; /* zero until following fields are valid */
113 unsigned long last_updated; /* in jiffies */ 113 unsigned long last_updated; /* in jiffies */
@@ -247,9 +247,9 @@ static int w83l785ts_detect(struct i2c_adapter *adapter, int address, int kind)
247 goto exit_remove; 247 goto exit_remove;
248 248
249 /* Register sysfs hooks */ 249 /* Register sysfs hooks */
250 data->class_dev = hwmon_device_register(&new_client->dev); 250 data->hwmon_dev = hwmon_device_register(&new_client->dev);
251 if (IS_ERR(data->class_dev)) { 251 if (IS_ERR(data->hwmon_dev)) {
252 err = PTR_ERR(data->class_dev); 252 err = PTR_ERR(data->hwmon_dev);
253 goto exit_remove; 253 goto exit_remove;
254 } 254 }
255 255
@@ -272,7 +272,7 @@ static int w83l785ts_detach_client(struct i2c_client *client)
272 struct w83l785ts_data *data = i2c_get_clientdata(client); 272 struct w83l785ts_data *data = i2c_get_clientdata(client);
273 int err; 273 int err;
274 274
275 hwmon_device_unregister(data->class_dev); 275 hwmon_device_unregister(data->hwmon_dev);
276 device_remove_file(&client->dev, 276 device_remove_file(&client->dev,
277 &sensor_dev_attr_temp1_input.dev_attr); 277 &sensor_dev_attr_temp1_input.dev_attr);
278 device_remove_file(&client->dev, 278 device_remove_file(&client->dev,
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 96581d08774f..51ae4fb7d123 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -83,7 +83,7 @@ struct ads7846 {
83 83
84#if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE) 84#if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE)
85 struct attribute_group *attr_group; 85 struct attribute_group *attr_group;
86 struct class_device *hwmon; 86 struct device *hwmon;
87#endif 87#endif
88 88
89 u16 model; 89 u16 model;
@@ -369,7 +369,7 @@ static struct attribute_group ads7845_attr_group = {
369 369
370static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts) 370static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts)
371{ 371{
372 struct class_device *hwmon; 372 struct device *hwmon;
373 int err; 373 int err;
374 374
375 /* hwmon sensors need a reference voltage */ 375 /* hwmon sensors need a reference voltage */
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 0222bbaf7b76..a717a25fb86a 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -517,7 +517,7 @@ static char *next_cmd(char **cmds)
517 ****************************************************************************/ 517 ****************************************************************************/
518 518
519static struct platform_device *tpacpi_pdev; 519static struct platform_device *tpacpi_pdev;
520static struct class_device *tpacpi_hwmon; 520static struct device *tpacpi_hwmon;
521static struct input_dev *tpacpi_inputdev; 521static struct input_dev *tpacpi_inputdev;
522 522
523 523
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index 082a1cbc16c0..acd5835ec889 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -171,7 +171,7 @@ static int parse_strtoul(const char *buf, unsigned long max,
171 171
172/* Device model */ 172/* Device model */
173static struct platform_device *tpacpi_pdev; 173static struct platform_device *tpacpi_pdev;
174static struct class_device *tpacpi_hwmon; 174static struct device *tpacpi_hwmon;
175static struct platform_driver tpacpi_pdriver; 175static struct platform_driver tpacpi_pdriver;
176static struct input_dev *tpacpi_inputdev; 176static struct input_dev *tpacpi_inputdev;
177static int tpacpi_create_driver_attributes(struct device_driver *drv); 177static int tpacpi_create_driver_attributes(struct device_driver *drv);
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
index 0efd994c37f1..6b6ee702b007 100644
--- a/include/linux/hwmon.h
+++ b/include/linux/hwmon.h
@@ -16,9 +16,9 @@
16 16
17#include <linux/device.h> 17#include <linux/device.h>
18 18
19struct class_device *hwmon_device_register(struct device *dev); 19struct device *hwmon_device_register(struct device *dev);
20 20
21void hwmon_device_unregister(struct class_device *cdev); 21void hwmon_device_unregister(struct device *dev);
22 22
23/* Scale user input to sensible values */ 23/* Scale user input to sensible values */
24static inline int SENSORS_LIMIT(long value, long low, long high) 24static inline int SENSORS_LIMIT(long value, long low, long high)