Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tony Jones and committed by
Mark M. Hoffman
1beeffe4 59a35baf

+308 -309
+5 -5
drivers/hwmon/abituguru.c
··· 176 176 The structure is dynamically allocated, at the same time when a new 177 177 abituguru device is allocated. */ 178 178 struct abituguru_data { 179 - struct class_device *class_dev; /* hwmon registered device */ 179 + struct device *hwmon_dev; /* hwmon registered device */ 180 180 struct mutex update_lock; /* protect access to data and uGuru */ 181 181 unsigned long last_updated; /* In jiffies */ 182 182 unsigned short addr; /* uguru base address */ ··· 1287 1287 &abituguru_sysfs_attr[i].dev_attr)) 1288 1288 goto abituguru_probe_error; 1289 1289 1290 - data->class_dev = hwmon_device_register(&pdev->dev); 1291 - if (!IS_ERR(data->class_dev)) 1290 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 1291 + if (!IS_ERR(data->hwmon_dev)) 1292 1292 return 0; /* success */ 1293 1293 1294 - res = PTR_ERR(data->class_dev); 1294 + res = PTR_ERR(data->hwmon_dev); 1295 1295 abituguru_probe_error: 1296 1296 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++) 1297 1297 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr); ··· 1308 1308 int i; 1309 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 1312 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++) 1313 1313 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr); 1314 1314 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++)
+5 -5
drivers/hwmon/abituguru3.c
··· 124 124 The structure is dynamically allocated, at the same time when a new 125 125 abituguru3 device is allocated. */ 126 126 struct abituguru3_data { 127 - struct class_device *class_dev; /* hwmon registered device */ 127 + struct device *hwmon_dev; /* hwmon registered device */ 128 128 struct mutex update_lock; /* protect access to data and uGuru */ 129 129 unsigned short addr; /* uguru base address */ 130 130 char valid; /* !=0 if following fields are valid */ ··· 933 933 &abituguru3_sysfs_attr[i].dev_attr)) 934 934 goto abituguru3_probe_error; 935 935 936 - data->class_dev = hwmon_device_register(&pdev->dev); 937 - if (IS_ERR(data->class_dev)) { 938 - res = PTR_ERR(data->class_dev); 936 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 937 + if (IS_ERR(data->hwmon_dev)) { 938 + res = PTR_ERR(data->hwmon_dev); 939 939 goto abituguru3_probe_error; 940 940 } 941 941 ··· 957 957 struct abituguru3_data *data = platform_get_drvdata(pdev); 958 958 959 959 platform_set_drvdata(pdev, NULL); 960 - hwmon_device_unregister(data->class_dev); 960 + hwmon_device_unregister(data->hwmon_dev); 961 961 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++) 962 962 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr); 963 963 for (i = 0; i < ARRAY_SIZE(abituguru3_sysfs_attr); i++)
+5 -5
drivers/hwmon/ad7418.c
··· 47 47 48 48 struct ad7418_data { 49 49 struct i2c_client client; 50 - struct class_device *class_dev; 50 + struct device *hwmon_dev; 51 51 struct attribute_group attrs; 52 52 enum chips type; 53 53 struct mutex lock; ··· 326 326 if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs))) 327 327 goto exit_detach; 328 328 329 - data->class_dev = hwmon_device_register(&client->dev); 330 - if (IS_ERR(data->class_dev)) { 331 - err = PTR_ERR(data->class_dev); 329 + data->hwmon_dev = hwmon_device_register(&client->dev); 330 + if (IS_ERR(data->hwmon_dev)) { 331 + err = PTR_ERR(data->hwmon_dev); 332 332 goto exit_remove; 333 333 } 334 334 ··· 347 347 static int ad7418_detach_client(struct i2c_client *client) 348 348 { 349 349 struct ad7418_data *data = i2c_get_clientdata(client); 350 - hwmon_device_unregister(data->class_dev); 350 + hwmon_device_unregister(data->hwmon_dev); 351 351 sysfs_remove_group(&client->dev.kobj, &data->attrs); 352 352 i2c_detach_client(client); 353 353 kfree(data);
+5 -5
drivers/hwmon/adm1021.c
··· 91 91 /* Each client has this additional data */ 92 92 struct adm1021_data { 93 93 struct i2c_client client; 94 - struct class_device *class_dev; 94 + struct device *hwmon_dev; 95 95 enum chips type; 96 96 97 97 struct mutex update_lock; ··· 319 319 if ((err = sysfs_create_group(&client->dev.kobj, &adm1021_group))) 320 320 goto error2; 321 321 322 - data->class_dev = hwmon_device_register(&client->dev); 323 - if (IS_ERR(data->class_dev)) { 324 - err = PTR_ERR(data->class_dev); 322 + data->hwmon_dev = hwmon_device_register(&client->dev); 323 + if (IS_ERR(data->hwmon_dev)) { 324 + err = PTR_ERR(data->hwmon_dev); 325 325 goto error3; 326 326 } 327 327 ··· 351 351 struct adm1021_data *data = i2c_get_clientdata(client); 352 352 int err; 353 353 354 - hwmon_device_unregister(data->class_dev); 354 + hwmon_device_unregister(data->hwmon_dev); 355 355 sysfs_remove_group(&client->dev.kobj, &adm1021_group); 356 356 357 357 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/adm1025.c
··· 133 133 134 134 struct adm1025_data { 135 135 struct i2c_client client; 136 - struct class_device *class_dev; 136 + struct device *hwmon_dev; 137 137 struct mutex update_lock; 138 138 char valid; /* zero until following fields are valid */ 139 139 unsigned long last_updated; /* in jiffies */ ··· 472 472 goto exit_remove; 473 473 } 474 474 475 - data->class_dev = hwmon_device_register(&new_client->dev); 476 - if (IS_ERR(data->class_dev)) { 477 - err = PTR_ERR(data->class_dev); 475 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 476 + if (IS_ERR(data->hwmon_dev)) { 477 + err = PTR_ERR(data->hwmon_dev); 478 478 goto exit_remove; 479 479 } 480 480 ··· 538 538 struct adm1025_data *data = i2c_get_clientdata(client); 539 539 int err; 540 540 541 - hwmon_device_unregister(data->class_dev); 541 + hwmon_device_unregister(data->hwmon_dev); 542 542 sysfs_remove_group(&client->dev.kobj, &adm1025_group); 543 543 sysfs_remove_group(&client->dev.kobj, &adm1025_group_opt); 544 544
+5 -5
drivers/hwmon/adm1026.c
··· 260 260 261 261 struct adm1026_data { 262 262 struct i2c_client client; 263 - struct class_device *class_dev; 263 + struct device *hwmon_dev; 264 264 enum chips type; 265 265 266 266 struct mutex update_lock; ··· 1676 1676 if ((err = sysfs_create_group(&new_client->dev.kobj, &adm1026_group))) 1677 1677 goto exitdetach; 1678 1678 1679 - data->class_dev = hwmon_device_register(&new_client->dev); 1680 - if (IS_ERR(data->class_dev)) { 1681 - err = PTR_ERR(data->class_dev); 1679 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 1680 + if (IS_ERR(data->hwmon_dev)) { 1681 + err = PTR_ERR(data->hwmon_dev); 1682 1682 goto exitremove; 1683 1683 } 1684 1684 ··· 1698 1698 static int adm1026_detach_client(struct i2c_client *client) 1699 1699 { 1700 1700 struct adm1026_data *data = i2c_get_clientdata(client); 1701 - hwmon_device_unregister(data->class_dev); 1701 + hwmon_device_unregister(data->hwmon_dev); 1702 1702 sysfs_remove_group(&client->dev.kobj, &adm1026_group); 1703 1703 i2c_detach_client(client); 1704 1704 kfree(data);
+5 -5
drivers/hwmon/adm1029.c
··· 141 141 142 142 struct adm1029_data { 143 143 struct i2c_client client; 144 - struct class_device *class_dev; 144 + struct device *hwmon_dev; 145 145 struct mutex update_lock; 146 146 char valid; /* zero until following fields are valid */ 147 147 unsigned long last_updated; /* in jiffies */ ··· 391 391 if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group))) 392 392 goto exit_detach; 393 393 394 - data->class_dev = hwmon_device_register(&client->dev); 395 - if (IS_ERR(data->class_dev)) { 396 - err = PTR_ERR(data->class_dev); 394 + data->hwmon_dev = hwmon_device_register(&client->dev); 395 + if (IS_ERR(data->hwmon_dev)) { 396 + err = PTR_ERR(data->hwmon_dev); 397 397 goto exit_remove_files; 398 398 } 399 399 ··· 431 431 struct adm1029_data *data = i2c_get_clientdata(client); 432 432 int err; 433 433 434 - hwmon_device_unregister(data->class_dev); 434 + hwmon_device_unregister(data->hwmon_dev); 435 435 sysfs_remove_group(&client->dev.kobj, &adm1029_group); 436 436 437 437 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/adm1031.c
··· 70 70 /* Each client has this additional data */ 71 71 struct adm1031_data { 72 72 struct i2c_client client; 73 - struct class_device *class_dev; 73 + struct device *hwmon_dev; 74 74 struct mutex update_lock; 75 75 int chip_type; 76 76 char valid; /* !=0 if following fields are valid */ ··· 853 853 goto exit_remove; 854 854 } 855 855 856 - data->class_dev = hwmon_device_register(&new_client->dev); 857 - if (IS_ERR(data->class_dev)) { 858 - err = PTR_ERR(data->class_dev); 856 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 857 + if (IS_ERR(data->hwmon_dev)) { 858 + err = PTR_ERR(data->hwmon_dev); 859 859 goto exit_remove; 860 860 } 861 861 ··· 877 877 struct adm1031_data *data = i2c_get_clientdata(client); 878 878 int ret; 879 879 880 - hwmon_device_unregister(data->class_dev); 880 + hwmon_device_unregister(data->hwmon_dev); 881 881 sysfs_remove_group(&client->dev.kobj, &adm1031_group); 882 882 sysfs_remove_group(&client->dev.kobj, &adm1031_group_opt); 883 883 if ((ret = i2c_detach_client(client)) != 0) {
+5 -5
drivers/hwmon/adm9240.c
··· 150 150 struct adm9240_data { 151 151 enum chips type; 152 152 struct i2c_client client; 153 - struct class_device *class_dev; 153 + struct device *hwmon_dev; 154 154 struct mutex update_lock; 155 155 char valid; 156 156 unsigned long last_updated_measure; ··· 590 590 if ((err = sysfs_create_group(&new_client->dev.kobj, &adm9240_group))) 591 591 goto exit_detach; 592 592 593 - data->class_dev = hwmon_device_register(&new_client->dev); 594 - if (IS_ERR(data->class_dev)) { 595 - err = PTR_ERR(data->class_dev); 593 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 594 + if (IS_ERR(data->hwmon_dev)) { 595 + err = PTR_ERR(data->hwmon_dev); 596 596 goto exit_remove; 597 597 } 598 598 ··· 620 620 struct adm9240_data *data = i2c_get_clientdata(client); 621 621 int err; 622 622 623 - hwmon_device_unregister(data->class_dev); 623 + hwmon_device_unregister(data->hwmon_dev); 624 624 sysfs_remove_group(&client->dev.kobj, &adm9240_group); 625 625 626 626 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/adt7470.c
··· 124 124 125 125 struct adt7470_data { 126 126 struct i2c_client client; 127 - struct class_device *class_dev; 127 + struct device *hwmon_dev; 128 128 struct attribute_group attrs; 129 129 struct mutex lock; 130 130 char sensors_valid; ··· 1003 1003 if ((err = sysfs_create_group(&client->dev.kobj, &data->attrs))) 1004 1004 goto exit_detach; 1005 1005 1006 - data->class_dev = hwmon_device_register(&client->dev); 1007 - if (IS_ERR(data->class_dev)) { 1008 - err = PTR_ERR(data->class_dev); 1006 + data->hwmon_dev = hwmon_device_register(&client->dev); 1007 + if (IS_ERR(data->hwmon_dev)) { 1008 + err = PTR_ERR(data->hwmon_dev); 1009 1009 goto exit_remove; 1010 1010 } 1011 1011 ··· 1025 1025 { 1026 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 1029 sysfs_remove_group(&client->dev.kobj, &data->attrs); 1030 1030 i2c_detach_client(client); 1031 1031 kfree(data);
+5 -5
drivers/hwmon/applesmc.c
··· 127 127 static s16 rest_y; 128 128 static struct timer_list applesmc_timer; 129 129 static struct input_dev *applesmc_idev; 130 - static struct class_device *hwmon_class_dev; 130 + static struct device *hwmon_dev; 131 131 132 132 /* Indicates whether this computer has an accelerometer. */ 133 133 static unsigned int applesmc_accelerometer; ··· 1287 1287 goto out_light_wq; 1288 1288 } 1289 1289 1290 - hwmon_class_dev = hwmon_device_register(&pdev->dev); 1291 - if (IS_ERR(hwmon_class_dev)) { 1292 - ret = PTR_ERR(hwmon_class_dev); 1290 + hwmon_dev = hwmon_device_register(&pdev->dev); 1291 + if (IS_ERR(hwmon_dev)) { 1292 + ret = PTR_ERR(hwmon_dev); 1293 1293 goto out_light_ledclass; 1294 1294 } 1295 1295 ··· 1331 1331 1332 1332 static void __exit applesmc_exit(void) 1333 1333 { 1334 - hwmon_device_unregister(hwmon_class_dev); 1334 + hwmon_device_unregister(hwmon_dev); 1335 1335 if (applesmc_light) { 1336 1336 led_classdev_unregister(&applesmc_backlight); 1337 1337 destroy_workqueue(applesmc_led_wq);
+5 -5
drivers/hwmon/asb100.c
··· 182 182 dynamically allocated, at the same time the client itself is allocated. */ 183 183 struct asb100_data { 184 184 struct i2c_client client; 185 - struct class_device *class_dev; 185 + struct device *hwmon_dev; 186 186 struct mutex lock; 187 187 enum chips type; 188 188 ··· 844 844 if ((err = sysfs_create_group(&new_client->dev.kobj, &asb100_group))) 845 845 goto ERROR3; 846 846 847 - data->class_dev = hwmon_device_register(&new_client->dev); 848 - if (IS_ERR(data->class_dev)) { 849 - err = PTR_ERR(data->class_dev); 847 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 848 + if (IS_ERR(data->hwmon_dev)) { 849 + err = PTR_ERR(data->hwmon_dev); 850 850 goto ERROR4; 851 851 } 852 852 ··· 874 874 875 875 /* main client */ 876 876 if (data) { 877 - hwmon_device_unregister(data->class_dev); 877 + hwmon_device_unregister(data->hwmon_dev); 878 878 sysfs_remove_group(&client->dev.kobj, &asb100_group); 879 879 } 880 880
+5 -5
drivers/hwmon/atxp1.c
··· 61 61 62 62 struct atxp1_data { 63 63 struct i2c_client client; 64 - struct class_device *class_dev; 64 + struct device *hwmon_dev; 65 65 struct mutex update_lock; 66 66 unsigned long last_updated; 67 67 u8 valid; ··· 335 335 if ((err = sysfs_create_group(&new_client->dev.kobj, &atxp1_group))) 336 336 goto exit_detach; 337 337 338 - data->class_dev = hwmon_device_register(&new_client->dev); 339 - if (IS_ERR(data->class_dev)) { 340 - err = PTR_ERR(data->class_dev); 338 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 339 + if (IS_ERR(data->hwmon_dev)) { 340 + err = PTR_ERR(data->hwmon_dev); 341 341 goto exit_remove_files; 342 342 } 343 343 ··· 361 361 struct atxp1_data * data = i2c_get_clientdata(client); 362 362 int err; 363 363 364 - hwmon_device_unregister(data->class_dev); 364 + hwmon_device_unregister(data->hwmon_dev); 365 365 sysfs_remove_group(&client->dev.kobj, &atxp1_group); 366 366 367 367 err = i2c_detach_client(client);
+5 -5
drivers/hwmon/coretemp.c
··· 47 47 static struct coretemp_data *coretemp_update_device(struct device *dev); 48 48 49 49 struct coretemp_data { 50 - struct class_device *class_dev; 50 + struct device *hwmon_dev; 51 51 struct mutex update_lock; 52 52 const char *name; 53 53 u32 id; ··· 226 226 if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group))) 227 227 goto exit_free; 228 228 229 - data->class_dev = hwmon_device_register(&pdev->dev); 230 - if (IS_ERR(data->class_dev)) { 231 - err = PTR_ERR(data->class_dev); 229 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 230 + if (IS_ERR(data->hwmon_dev)) { 231 + err = PTR_ERR(data->hwmon_dev); 232 232 dev_err(&pdev->dev, "Class registration failed (%d)\n", 233 233 err); 234 234 goto exit_class; ··· 248 248 { 249 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 252 sysfs_remove_group(&pdev->dev.kobj, &coretemp_group); 253 253 platform_set_drvdata(pdev, NULL); 254 254 kfree(data);
+5 -5
drivers/hwmon/dme1737.c
··· 155 155 156 156 struct dme1737_data { 157 157 struct i2c_client client; 158 - struct class_device *class_dev; 158 + struct device *hwmon_dev; 159 159 160 160 struct mutex update_lock; 161 161 int valid; /* !=0 if following fields are valid */ ··· 1983 1983 } 1984 1984 1985 1985 /* Register device */ 1986 - data->class_dev = hwmon_device_register(&client->dev); 1987 - if (IS_ERR(data->class_dev)) { 1988 - err = PTR_ERR(data->class_dev); 1986 + data->hwmon_dev = hwmon_device_register(&client->dev); 1987 + if (IS_ERR(data->hwmon_dev)) { 1988 + err = PTR_ERR(data->hwmon_dev); 1989 1989 goto exit_remove; 1990 1990 } 1991 1991 ··· 2030 2030 struct dme1737_data *data = i2c_get_clientdata(client); 2031 2031 int ix, err; 2032 2032 2033 - hwmon_device_unregister(data->class_dev); 2033 + hwmon_device_unregister(data->hwmon_dev); 2034 2034 2035 2035 for (ix = 0; ix < ARRAY_SIZE(dme1737_fan_group); ix++) { 2036 2036 if (data->has_fan & (1 << ix)) {
+5 -5
drivers/hwmon/ds1621.c
··· 73 73 /* Each client has this additional data */ 74 74 struct ds1621_data { 75 75 struct i2c_client client; 76 - struct class_device *class_dev; 76 + struct device *hwmon_dev; 77 77 struct mutex update_lock; 78 78 char valid; /* !=0 if following fields are valid */ 79 79 unsigned long last_updated; /* In jiffies */ ··· 266 266 if ((err = sysfs_create_group(&client->dev.kobj, &ds1621_group))) 267 267 goto exit_detach; 268 268 269 - data->class_dev = hwmon_device_register(&client->dev); 270 - if (IS_ERR(data->class_dev)) { 271 - err = PTR_ERR(data->class_dev); 269 + data->hwmon_dev = hwmon_device_register(&client->dev); 270 + if (IS_ERR(data->hwmon_dev)) { 271 + err = PTR_ERR(data->hwmon_dev); 272 272 goto exit_remove_files; 273 273 } 274 274 ··· 289 289 struct ds1621_data *data = i2c_get_clientdata(client); 290 290 int err; 291 291 292 - hwmon_device_unregister(data->class_dev); 292 + hwmon_device_unregister(data->hwmon_dev); 293 293 sysfs_remove_group(&client->dev.kobj, &ds1621_group); 294 294 295 295 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/f71805f.c
··· 162 162 struct f71805f_data { 163 163 unsigned short addr; 164 164 const char *name; 165 - struct class_device *class_dev; 165 + struct device *hwmon_dev; 166 166 167 167 struct mutex update_lock; 168 168 char valid; /* !=0 if following fields are valid */ ··· 1381 1381 } 1382 1382 } 1383 1383 1384 - data->class_dev = hwmon_device_register(&pdev->dev); 1385 - if (IS_ERR(data->class_dev)) { 1386 - err = PTR_ERR(data->class_dev); 1384 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 1385 + if (IS_ERR(data->hwmon_dev)) { 1386 + err = PTR_ERR(data->hwmon_dev); 1387 1387 dev_err(&pdev->dev, "Class registration failed (%d)\n", err); 1388 1388 goto exit_remove_files; 1389 1389 } ··· 1410 1410 struct resource *res; 1411 1411 int i; 1412 1412 1413 - hwmon_device_unregister(data->class_dev); 1413 + hwmon_device_unregister(data->hwmon_dev); 1414 1414 sysfs_remove_group(&pdev->dev.kobj, &f71805f_group); 1415 1415 for (i = 0; i < 4; i++) 1416 1416 sysfs_remove_group(&pdev->dev.kobj, &f71805f_group_optin[i]);
+5 -5
drivers/hwmon/f71882fg.c
··· 87 87 88 88 struct f71882fg_data { 89 89 unsigned short addr; 90 - struct class_device *class_dev; 90 + struct device *hwmon_dev; 91 91 92 92 struct mutex update_lock; 93 93 char valid; /* !=0 if following fields are valid */ ··· 781 781 } 782 782 } 783 783 784 - data->class_dev = hwmon_device_register(&pdev->dev); 785 - if (IS_ERR(data->class_dev)) { 786 - err = PTR_ERR(data->class_dev); 784 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 785 + if (IS_ERR(data->hwmon_dev)) { 786 + err = PTR_ERR(data->hwmon_dev); 787 787 goto exit_unregister_sysfs; 788 788 } 789 789 ··· 811 811 struct f71882fg_data *data = platform_get_drvdata(pdev); 812 812 813 813 platform_set_drvdata(pdev, NULL); 814 - hwmon_device_unregister(data->class_dev); 814 + hwmon_device_unregister(data->hwmon_dev); 815 815 816 816 for (i = 0; i < ARRAY_SIZE(f71882fg_dev_attr); i++) 817 817 device_remove_file(&pdev->dev, &f71882fg_dev_attr[i]);
+5 -5
drivers/hwmon/f75375s.c
··· 87 87 struct f75375_data { 88 88 unsigned short addr; 89 89 struct i2c_client client; 90 - struct class_device *class_dev; 90 + struct device *hwmon_dev; 91 91 92 92 const char *name; 93 93 int kind; ··· 583 583 struct f75375_data *data = i2c_get_clientdata(client); 584 584 int err; 585 585 586 - hwmon_device_unregister(data->class_dev); 586 + hwmon_device_unregister(data->hwmon_dev); 587 587 sysfs_remove_group(&client->dev.kobj, &f75375_group); 588 588 589 589 err = i2c_detach_client(client); ··· 655 655 if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group))) 656 656 goto exit_detach; 657 657 658 - data->class_dev = hwmon_device_register(&client->dev); 659 - if (IS_ERR(data->class_dev)) { 660 - err = PTR_ERR(data->class_dev); 658 + data->hwmon_dev = hwmon_device_register(&client->dev); 659 + if (IS_ERR(data->hwmon_dev)) { 660 + err = PTR_ERR(data->hwmon_dev); 661 661 goto exit_remove; 662 662 } 663 663
+5 -5
drivers/hwmon/fscher.c
··· 134 134 135 135 struct fscher_data { 136 136 struct i2c_client client; 137 - struct class_device *class_dev; 137 + struct device *hwmon_dev; 138 138 struct mutex update_lock; 139 139 char valid; /* zero until following fields are valid */ 140 140 unsigned long last_updated; /* in jiffies */ ··· 344 344 if ((err = sysfs_create_group(&new_client->dev.kobj, &fscher_group))) 345 345 goto exit_detach; 346 346 347 - data->class_dev = hwmon_device_register(&new_client->dev); 348 - if (IS_ERR(data->class_dev)) { 349 - err = PTR_ERR(data->class_dev); 347 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 348 + if (IS_ERR(data->hwmon_dev)) { 349 + err = PTR_ERR(data->hwmon_dev); 350 350 goto exit_remove_files; 351 351 } 352 352 ··· 367 367 struct fscher_data *data = i2c_get_clientdata(client); 368 368 int err; 369 369 370 - hwmon_device_unregister(data->class_dev); 370 + hwmon_device_unregister(data->hwmon_dev); 371 371 sysfs_remove_group(&client->dev.kobj, &fscher_group); 372 372 373 373 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/fscpos.c
··· 115 115 */ 116 116 struct fscpos_data { 117 117 struct i2c_client client; 118 - struct class_device *class_dev; 118 + struct device *hwmon_dev; 119 119 struct mutex update_lock; 120 120 char valid; /* 0 until following fields are valid */ 121 121 unsigned long last_updated; /* In jiffies */ ··· 539 539 if ((err = sysfs_create_group(&new_client->dev.kobj, &fscpos_group))) 540 540 goto exit_detach; 541 541 542 - data->class_dev = hwmon_device_register(&new_client->dev); 543 - if (IS_ERR(data->class_dev)) { 544 - err = PTR_ERR(data->class_dev); 542 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 543 + if (IS_ERR(data->hwmon_dev)) { 544 + err = PTR_ERR(data->hwmon_dev); 545 545 goto exit_remove_files; 546 546 } 547 547 ··· 562 562 struct fscpos_data *data = i2c_get_clientdata(client); 563 563 int err; 564 564 565 - hwmon_device_unregister(data->class_dev); 565 + hwmon_device_unregister(data->hwmon_dev); 566 566 sysfs_remove_group(&client->dev.kobj, &fscpos_group); 567 567 568 568 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/gl518sm.c
··· 119 119 /* Each client has this additional data */ 120 120 struct gl518_data { 121 121 struct i2c_client client; 122 - struct class_device *class_dev; 122 + struct device *hwmon_dev; 123 123 enum chips type; 124 124 125 125 struct mutex update_lock; ··· 460 460 if ((err = sysfs_create_group(&new_client->dev.kobj, &gl518_group))) 461 461 goto exit_detach; 462 462 463 - data->class_dev = hwmon_device_register(&new_client->dev); 464 - if (IS_ERR(data->class_dev)) { 465 - err = PTR_ERR(data->class_dev); 463 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 464 + if (IS_ERR(data->hwmon_dev)) { 465 + err = PTR_ERR(data->hwmon_dev); 466 466 goto exit_remove_files; 467 467 } 468 468 ··· 502 502 struct gl518_data *data = i2c_get_clientdata(client); 503 503 int err; 504 504 505 - hwmon_device_unregister(data->class_dev); 505 + hwmon_device_unregister(data->hwmon_dev); 506 506 sysfs_remove_group(&client->dev.kobj, &gl518_group); 507 507 508 508 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/gl520sm.c
··· 122 122 /* Client data */ 123 123 struct gl520_data { 124 124 struct i2c_client client; 125 - struct class_device *class_dev; 125 + struct device *hwmon_dev; 126 126 struct mutex update_lock; 127 127 char valid; /* zero until the following fields are valid */ 128 128 unsigned long last_updated; /* in jiffies */ ··· 622 622 } 623 623 624 624 625 - data->class_dev = hwmon_device_register(&new_client->dev); 626 - if (IS_ERR(data->class_dev)) { 627 - err = PTR_ERR(data->class_dev); 625 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 626 + if (IS_ERR(data->hwmon_dev)) { 627 + err = PTR_ERR(data->hwmon_dev); 628 628 goto exit_remove_files; 629 629 } 630 630 ··· 685 685 struct gl520_data *data = i2c_get_clientdata(client); 686 686 int err; 687 687 688 - hwmon_device_unregister(data->class_dev); 688 + hwmon_device_unregister(data->hwmon_dev); 689 689 sysfs_remove_group(&client->dev.kobj, &gl520_group); 690 690 sysfs_remove_group(&client->dev.kobj, &gl520_group_opt); 691 691
+13 -14
drivers/hwmon/hwmon.c
··· 28 28 static 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 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 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 */ 39 - struct class_device *hwmon_device_register(struct device *dev) 39 + struct device *hwmon_device_register(struct device *dev) 40 40 { 41 - struct class_device *cdev; 41 + struct device *hwdev; 42 42 int id, err; 43 43 44 44 again: ··· 55 55 return ERR_PTR(err); 56 56 57 57 id = id & MAX_ID_MASK; 58 - cdev = class_device_create(hwmon_class, NULL, MKDEV(0,0), dev, 59 - HWMON_ID_FORMAT, id); 58 + hwdev = device_create(hwmon_class, dev, MKDEV(0,0), HWMON_ID_FORMAT, id); 60 59 61 - if (IS_ERR(cdev)) { 60 + if (IS_ERR(hwdev)) { 62 61 spin_lock(&idr_lock); 63 62 idr_remove(&hwmon_idr, id); 64 63 spin_unlock(&idr_lock); 65 64 } 66 65 67 - return cdev; 66 + return hwdev; 68 67 } 69 68 70 69 /** 71 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 */ 75 - void hwmon_device_unregister(struct class_device *cdev) 74 + void hwmon_device_unregister(struct device *dev) 76 75 { 77 76 int id; 78 77 79 - if (likely(sscanf(cdev->class_id, HWMON_ID_FORMAT, &id) == 1)) { 80 - class_device_unregister(cdev); 78 + if (likely(sscanf(dev->bus_id, HWMON_ID_FORMAT, &id) == 1)) { 79 + device_unregister(dev); 81 80 spin_lock(&idr_lock); 82 81 idr_remove(&hwmon_idr, id); 83 82 spin_unlock(&idr_lock); 84 83 } else 85 - dev_dbg(cdev->dev, 84 + dev_dbg(dev->parent, 86 85 "hwmon_device_unregister() failed: bad class ID!\n"); 87 86 } 88 87
+5 -5
drivers/hwmon/it87.c
··· 222 222 /* For each registered chip, we need to keep some data in memory. 223 223 The structure is dynamically allocated. */ 224 224 struct it87_data { 225 - struct class_device *class_dev; 225 + struct device *hwmon_dev; 226 226 enum chips type; 227 227 228 228 unsigned short addr; ··· 1089 1089 goto ERROR4; 1090 1090 } 1091 1091 1092 - data->class_dev = hwmon_device_register(dev); 1093 - if (IS_ERR(data->class_dev)) { 1094 - err = PTR_ERR(data->class_dev); 1092 + data->hwmon_dev = hwmon_device_register(dev); 1093 + if (IS_ERR(data->hwmon_dev)) { 1094 + err = PTR_ERR(data->hwmon_dev); 1095 1095 goto ERROR4; 1096 1096 } 1097 1097 ··· 1113 1113 { 1114 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 1117 sysfs_remove_group(&pdev->dev.kobj, &it87_group); 1118 1118 sysfs_remove_group(&pdev->dev.kobj, &it87_group_opt); 1119 1119
+5 -5
drivers/hwmon/k8temp.c
··· 38 38 #define SEL_CORE 0x04 39 39 40 40 struct k8temp_data { 41 - struct class_device *class_dev; 41 + struct device *hwmon_dev; 42 42 struct mutex update_lock; 43 43 const char *name; 44 44 char valid; /* zero until following fields are valid */ ··· 225 225 if (err) 226 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)) { 231 - err = PTR_ERR(data->class_dev); 230 + if (IS_ERR(data->hwmon_dev)) { 231 + err = PTR_ERR(data->hwmon_dev); 232 232 goto exit_remove; 233 233 } 234 234 ··· 255 255 { 256 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 259 device_remove_file(&pdev->dev, 260 260 &sensor_dev_attr_temp1_input.dev_attr); 261 261 device_remove_file(&pdev->dev,
+5 -5
drivers/hwmon/lm63.c
··· 154 154 155 155 struct lm63_data { 156 156 struct i2c_client client; 157 - struct class_device *class_dev; 157 + struct device *hwmon_dev; 158 158 struct mutex update_lock; 159 159 char valid; /* zero until following fields are valid */ 160 160 unsigned long last_updated; /* in jiffies */ ··· 502 502 goto exit_remove_files; 503 503 } 504 504 505 - data->class_dev = hwmon_device_register(&new_client->dev); 506 - if (IS_ERR(data->class_dev)) { 507 - err = PTR_ERR(data->class_dev); 505 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 506 + if (IS_ERR(data->hwmon_dev)) { 507 + err = PTR_ERR(data->hwmon_dev); 508 508 goto exit_remove_files; 509 509 } 510 510 ··· 561 561 struct lm63_data *data = i2c_get_clientdata(client); 562 562 int err; 563 563 564 - hwmon_device_unregister(data->class_dev); 564 + hwmon_device_unregister(data->hwmon_dev); 565 565 sysfs_remove_group(&client->dev.kobj, &lm63_group); 566 566 sysfs_remove_group(&client->dev.kobj, &lm63_group_fan1); 567 567
+6 -6
drivers/hwmon/lm70.c
··· 37 37 #define DRVNAME "lm70" 38 38 39 39 struct lm70 { 40 - struct class_device *cdev; 40 + struct device *hwmon_dev; 41 41 struct semaphore sem; 42 42 }; 43 43 ··· 115 115 init_MUTEX(&p_lm70->sem); 116 116 117 117 /* sysfs hook */ 118 - p_lm70->cdev = hwmon_device_register(&spi->dev); 119 - if (IS_ERR(p_lm70->cdev)) { 118 + p_lm70->hwmon_dev = hwmon_device_register(&spi->dev); 119 + if (IS_ERR(p_lm70->hwmon_dev)) { 120 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 122 goto out_dev_reg_failed; 123 123 } 124 124 dev_set_drvdata(&spi->dev, p_lm70); ··· 133 133 134 134 out_dev_create_file_failed: 135 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); 137 137 out_dev_reg_failed: 138 138 dev_set_drvdata(&spi->dev, NULL); 139 139 kfree(p_lm70); ··· 146 146 147 147 device_remove_file(&spi->dev, &dev_attr_temp1_input); 148 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 150 dev_set_drvdata(&spi->dev, NULL); 151 151 kfree(p_lm70); 152 152
+5 -5
drivers/hwmon/lm75.c
··· 50 50 /* Each client has this additional data */ 51 51 struct lm75_data { 52 52 struct i2c_client client; 53 - struct class_device *class_dev; 53 + struct device *hwmon_dev; 54 54 struct mutex update_lock; 55 55 char valid; /* !=0 if following fields are valid */ 56 56 unsigned long last_updated; /* In jiffies */ ··· 219 219 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm75_group))) 220 220 goto exit_detach; 221 221 222 - data->class_dev = hwmon_device_register(&new_client->dev); 223 - if (IS_ERR(data->class_dev)) { 224 - err = PTR_ERR(data->class_dev); 222 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 223 + if (IS_ERR(data->hwmon_dev)) { 224 + err = PTR_ERR(data->hwmon_dev); 225 225 goto exit_remove; 226 226 } 227 227 ··· 240 240 static int lm75_detach_client(struct i2c_client *client) 241 241 { 242 242 struct lm75_data *data = i2c_get_clientdata(client); 243 - hwmon_device_unregister(data->class_dev); 243 + hwmon_device_unregister(data->hwmon_dev); 244 244 sysfs_remove_group(&client->dev.kobj, &lm75_group); 245 245 i2c_detach_client(client); 246 246 kfree(data);
+5 -5
drivers/hwmon/lm77.c
··· 51 51 /* Each client has this additional data */ 52 52 struct lm77_data { 53 53 struct i2c_client client; 54 - struct class_device *class_dev; 54 + struct device *hwmon_dev; 55 55 struct mutex update_lock; 56 56 char valid; 57 57 unsigned long last_updated; /* In jiffies */ ··· 337 337 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm77_group))) 338 338 goto exit_detach; 339 339 340 - data->class_dev = hwmon_device_register(&new_client->dev); 341 - if (IS_ERR(data->class_dev)) { 342 - err = PTR_ERR(data->class_dev); 340 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 341 + if (IS_ERR(data->hwmon_dev)) { 342 + err = PTR_ERR(data->hwmon_dev); 343 343 goto exit_remove; 344 344 } 345 345 ··· 358 358 static int lm77_detach_client(struct i2c_client *client) 359 359 { 360 360 struct lm77_data *data = i2c_get_clientdata(client); 361 - hwmon_device_unregister(data->class_dev); 361 + hwmon_device_unregister(data->hwmon_dev); 362 362 sysfs_remove_group(&client->dev.kobj, &lm77_group); 363 363 i2c_detach_client(client); 364 364 kfree(data);
+9 -9
drivers/hwmon/lm78.c
··· 131 131 the driver field to differentiate between I2C and ISA chips. */ 132 132 struct lm78_data { 133 133 struct i2c_client client; 134 - struct class_device *class_dev; 134 + struct device *hwmon_dev; 135 135 struct mutex lock; 136 136 enum chips type; 137 137 ··· 585 585 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm78_group))) 586 586 goto ERROR3; 587 587 588 - data->class_dev = hwmon_device_register(&new_client->dev); 589 - if (IS_ERR(data->class_dev)) { 590 - err = PTR_ERR(data->class_dev); 588 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 589 + if (IS_ERR(data->hwmon_dev)) { 590 + err = PTR_ERR(data->hwmon_dev); 591 591 goto ERROR4; 592 592 } 593 593 ··· 608 608 struct lm78_data *data = i2c_get_clientdata(client); 609 609 int err; 610 610 611 - hwmon_device_unregister(data->class_dev); 611 + hwmon_device_unregister(data->hwmon_dev); 612 612 sysfs_remove_group(&client->dev.kobj, &lm78_group); 613 613 614 614 if ((err = i2c_detach_client(client))) ··· 659 659 || (err = device_create_file(&pdev->dev, &dev_attr_name))) 660 660 goto exit_remove_files; 661 661 662 - data->class_dev = hwmon_device_register(&pdev->dev); 663 - if (IS_ERR(data->class_dev)) { 664 - err = PTR_ERR(data->class_dev); 662 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 663 + if (IS_ERR(data->hwmon_dev)) { 664 + err = PTR_ERR(data->hwmon_dev); 665 665 goto exit_remove_files; 666 666 } 667 667 ··· 681 681 { 682 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 685 sysfs_remove_group(&pdev->dev.kobj, &lm78_group); 686 686 device_remove_file(&pdev->dev, &dev_attr_name); 687 687 release_region(data->client.addr, LM78_EXTENT);
+5 -5
drivers/hwmon/lm80.c
··· 108 108 109 109 struct lm80_data { 110 110 struct i2c_client client; 111 - struct class_device *class_dev; 111 + struct device *hwmon_dev; 112 112 struct mutex update_lock; 113 113 char valid; /* !=0 if following fields are valid */ 114 114 unsigned long last_updated; /* In jiffies */ ··· 497 497 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm80_group))) 498 498 goto error_detach; 499 499 500 - data->class_dev = hwmon_device_register(&new_client->dev); 501 - if (IS_ERR(data->class_dev)) { 502 - err = PTR_ERR(data->class_dev); 500 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 501 + if (IS_ERR(data->hwmon_dev)) { 502 + err = PTR_ERR(data->hwmon_dev); 503 503 goto error_remove; 504 504 } 505 505 ··· 520 520 struct lm80_data *data = i2c_get_clientdata(client); 521 521 int err; 522 522 523 - hwmon_device_unregister(data->class_dev); 523 + hwmon_device_unregister(data->hwmon_dev); 524 524 sysfs_remove_group(&client->dev.kobj, &lm80_group); 525 525 if ((err = i2c_detach_client(client))) 526 526 return err;
+5 -5
drivers/hwmon/lm83.c
··· 144 144 145 145 struct lm83_data { 146 146 struct i2c_client client; 147 - struct class_device *class_dev; 147 + struct device *hwmon_dev; 148 148 struct mutex update_lock; 149 149 char valid; /* zero until following fields are valid */ 150 150 unsigned long last_updated; /* in jiffies */ ··· 400 400 goto exit_remove_files; 401 401 } 402 402 403 - data->class_dev = hwmon_device_register(&new_client->dev); 404 - if (IS_ERR(data->class_dev)) { 405 - err = PTR_ERR(data->class_dev); 403 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 404 + if (IS_ERR(data->hwmon_dev)) { 405 + err = PTR_ERR(data->hwmon_dev); 406 406 goto exit_remove_files; 407 407 } 408 408 ··· 424 424 struct lm83_data *data = i2c_get_clientdata(client); 425 425 int err; 426 426 427 - hwmon_device_unregister(data->class_dev); 427 + hwmon_device_unregister(data->hwmon_dev); 428 428 sysfs_remove_group(&client->dev.kobj, &lm83_group); 429 429 sysfs_remove_group(&client->dev.kobj, &lm83_group_opt); 430 430
+5 -5
drivers/hwmon/lm85.c
··· 328 328 The structure is dynamically allocated. */ 329 329 struct lm85_data { 330 330 struct i2c_client client; 331 - struct class_device *class_dev; 331 + struct device *hwmon_dev; 332 332 enum chips type; 333 333 334 334 struct mutex update_lock; ··· 1257 1257 &dev_attr_in4_max))) 1258 1258 goto ERROR3; 1259 1259 1260 - data->class_dev = hwmon_device_register(&new_client->dev); 1261 - if (IS_ERR(data->class_dev)) { 1262 - err = PTR_ERR(data->class_dev); 1260 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 1261 + if (IS_ERR(data->hwmon_dev)) { 1262 + err = PTR_ERR(data->hwmon_dev); 1263 1263 goto ERROR3; 1264 1264 } 1265 1265 ··· 1280 1280 static int lm85_detach_client(struct i2c_client *client) 1281 1281 { 1282 1282 struct lm85_data *data = i2c_get_clientdata(client); 1283 - hwmon_device_unregister(data->class_dev); 1283 + hwmon_device_unregister(data->hwmon_dev); 1284 1284 sysfs_remove_group(&client->dev.kobj, &lm85_group); 1285 1285 sysfs_remove_group(&client->dev.kobj, &lm85_group_opt); 1286 1286 i2c_detach_client(client);
+5 -5
drivers/hwmon/lm87.c
··· 176 176 177 177 struct lm87_data { 178 178 struct i2c_client client; 179 - struct class_device *class_dev; 179 + struct device *hwmon_dev; 180 180 struct mutex update_lock; 181 181 char valid; /* zero until following fields are valid */ 182 182 unsigned long last_updated; /* In jiffies */ ··· 755 755 goto exit_remove; 756 756 } 757 757 758 - data->class_dev = hwmon_device_register(&new_client->dev); 759 - if (IS_ERR(data->class_dev)) { 760 - err = PTR_ERR(data->class_dev); 758 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 759 + if (IS_ERR(data->hwmon_dev)) { 760 + err = PTR_ERR(data->hwmon_dev); 761 761 goto exit_remove; 762 762 } 763 763 ··· 816 816 struct lm87_data *data = i2c_get_clientdata(client); 817 817 int err; 818 818 819 - hwmon_device_unregister(data->class_dev); 819 + hwmon_device_unregister(data->hwmon_dev); 820 820 sysfs_remove_group(&client->dev.kobj, &lm87_group); 821 821 sysfs_remove_group(&client->dev.kobj, &lm87_group_opt); 822 822
+5 -5
drivers/hwmon/lm90.c
··· 214 214 215 215 struct lm90_data { 216 216 struct i2c_client client; 217 - struct class_device *class_dev; 217 + struct device *hwmon_dev; 218 218 struct mutex update_lock; 219 219 char valid; /* zero until following fields are valid */ 220 220 unsigned long last_updated; /* in jiffies */ ··· 653 653 goto exit_remove_files; 654 654 } 655 655 656 - data->class_dev = hwmon_device_register(&new_client->dev); 657 - if (IS_ERR(data->class_dev)) { 658 - err = PTR_ERR(data->class_dev); 656 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 657 + if (IS_ERR(data->hwmon_dev)) { 658 + err = PTR_ERR(data->hwmon_dev); 659 659 goto exit_remove_files; 660 660 } 661 661 ··· 707 707 struct lm90_data *data = i2c_get_clientdata(client); 708 708 int err; 709 709 710 - hwmon_device_unregister(data->class_dev); 710 + hwmon_device_unregister(data->hwmon_dev); 711 711 sysfs_remove_group(&client->dev.kobj, &lm90_group); 712 712 device_remove_file(&client->dev, &dev_attr_pec); 713 713
+5 -5
drivers/hwmon/lm92.c
··· 96 96 /* Client data (each client gets its own) */ 97 97 struct lm92_data { 98 98 struct i2c_client client; 99 - struct class_device *class_dev; 99 + struct device *hwmon_dev; 100 100 struct mutex update_lock; 101 101 char valid; /* zero until following fields are valid */ 102 102 unsigned long last_updated; /* in jiffies */ ··· 379 379 if ((err = sysfs_create_group(&new_client->dev.kobj, &lm92_group))) 380 380 goto exit_detach; 381 381 382 - data->class_dev = hwmon_device_register(&new_client->dev); 383 - if (IS_ERR(data->class_dev)) { 384 - err = PTR_ERR(data->class_dev); 382 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 383 + if (IS_ERR(data->hwmon_dev)) { 384 + err = PTR_ERR(data->hwmon_dev); 385 385 goto exit_remove; 386 386 } 387 387 ··· 409 409 struct lm92_data *data = i2c_get_clientdata(client); 410 410 int err; 411 411 412 - hwmon_device_unregister(data->class_dev); 412 + hwmon_device_unregister(data->hwmon_dev); 413 413 sysfs_remove_group(&client->dev.kobj, &lm92_group); 414 414 415 415 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/lm93.c
··· 201 201 */ 202 202 struct lm93_data { 203 203 struct i2c_client client; 204 - struct class_device *class_dev; 204 + struct device *hwmon_dev; 205 205 206 206 struct mutex update_lock; 207 207 unsigned long last_updated; /* In jiffies */ ··· 2590 2590 goto err_detach; 2591 2591 2592 2592 /* Register hwmon driver class */ 2593 - data->class_dev = hwmon_device_register(&client->dev); 2594 - if ( !IS_ERR(data->class_dev)) 2593 + data->hwmon_dev = hwmon_device_register(&client->dev); 2594 + if ( !IS_ERR(data->hwmon_dev)) 2595 2595 return 0; 2596 2596 2597 - err = PTR_ERR(data->class_dev); 2597 + err = PTR_ERR(data->hwmon_dev); 2598 2598 dev_err(&client->dev, "error registering hwmon device.\n"); 2599 2599 sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp); 2600 2600 err_detach: ··· 2619 2619 struct lm93_data *data = i2c_get_clientdata(client); 2620 2620 int err = 0; 2621 2621 2622 - hwmon_device_unregister(data->class_dev); 2622 + hwmon_device_unregister(data->hwmon_dev); 2623 2623 sysfs_remove_group(&client->dev.kobj, &lm93_attr_grp); 2624 2624 2625 2625 err = i2c_detach_client(client);
+5 -5
drivers/hwmon/max1619.c
··· 105 105 106 106 struct max1619_data { 107 107 struct i2c_client client; 108 - struct class_device *class_dev; 108 + struct device *hwmon_dev; 109 109 struct mutex update_lock; 110 110 char valid; /* zero until following fields are valid */ 111 111 unsigned long last_updated; /* in jiffies */ ··· 293 293 if ((err = sysfs_create_group(&new_client->dev.kobj, &max1619_group))) 294 294 goto exit_detach; 295 295 296 - data->class_dev = hwmon_device_register(&new_client->dev); 297 - if (IS_ERR(data->class_dev)) { 298 - err = PTR_ERR(data->class_dev); 296 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 297 + if (IS_ERR(data->hwmon_dev)) { 298 + err = PTR_ERR(data->hwmon_dev); 299 299 goto exit_remove_files; 300 300 } 301 301 ··· 331 331 struct max1619_data *data = i2c_get_clientdata(client); 332 332 int err; 333 333 334 - hwmon_device_unregister(data->class_dev); 334 + hwmon_device_unregister(data->hwmon_dev); 335 335 sysfs_remove_group(&client->dev.kobj, &max1619_group); 336 336 337 337 if ((err = i2c_detach_client(client)))
+5 -5
drivers/hwmon/max6650.c
··· 128 128 struct max6650_data 129 129 { 130 130 struct i2c_client client; 131 - struct class_device *class_dev; 131 + struct device *hwmon_dev; 132 132 struct mutex update_lock; 133 133 char valid; /* zero until following fields are valid */ 134 134 unsigned long last_updated; /* in jiffies */ ··· 523 523 if (err) 524 524 goto err_detach; 525 525 526 - data->class_dev = hwmon_device_register(&client->dev); 527 - if (!IS_ERR(data->class_dev)) 526 + data->hwmon_dev = hwmon_device_register(&client->dev); 527 + if (!IS_ERR(data->hwmon_dev)) 528 528 return 0; 529 529 530 - err = PTR_ERR(data->class_dev); 530 + err = PTR_ERR(data->hwmon_dev); 531 531 dev_err(&client->dev, "error registering hwmon device.\n"); 532 532 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp); 533 533 err_detach: ··· 543 543 int err; 544 544 545 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 547 err = i2c_detach_client(client); 548 548 if (!err) 549 549 kfree(data);
+5 -5
drivers/hwmon/pc87360.c
··· 180 180 181 181 struct pc87360_data { 182 182 const char *name; 183 - struct class_device *class_dev; 183 + struct device *hwmon_dev; 184 184 struct mutex lock; 185 185 struct mutex update_lock; 186 186 char valid; /* !=0 if following fields are valid */ ··· 1054 1054 if ((err = device_create_file(dev, &dev_attr_name))) 1055 1055 goto ERROR3; 1056 1056 1057 - data->class_dev = hwmon_device_register(dev); 1058 - if (IS_ERR(data->class_dev)) { 1059 - err = PTR_ERR(data->class_dev); 1057 + data->hwmon_dev = hwmon_device_register(dev); 1058 + if (IS_ERR(data->hwmon_dev)) { 1059 + err = PTR_ERR(data->hwmon_dev); 1060 1060 goto ERROR3; 1061 1061 } 1062 1062 return 0; ··· 1083 1083 struct pc87360_data *data = platform_get_drvdata(pdev); 1084 1084 int i; 1085 1085 1086 - hwmon_device_unregister(data->class_dev); 1086 + hwmon_device_unregister(data->hwmon_dev); 1087 1087 1088 1088 device_remove_file(&pdev->dev, &dev_attr_name); 1089 1089 sysfs_remove_group(&pdev->dev.kobj, &pc8736x_temp_group);
+5 -5
drivers/hwmon/pc87427.c
··· 42 42 device is using banked registers) and the register cache (needed to keep 43 43 the data in the registers and the cache in sync at any time). */ 44 44 struct pc87427_data { 45 - struct class_device *class_dev; 45 + struct device *hwmon_dev; 46 46 struct mutex lock; 47 47 int address[2]; 48 48 const char *name; ··· 454 454 goto exit_remove_files; 455 455 } 456 456 457 - data->class_dev = hwmon_device_register(&pdev->dev); 458 - if (IS_ERR(data->class_dev)) { 459 - err = PTR_ERR(data->class_dev); 457 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 458 + if (IS_ERR(data->hwmon_dev)) { 459 + err = PTR_ERR(data->hwmon_dev); 460 460 dev_err(&pdev->dev, "Class registration failed (%d)\n", err); 461 461 goto exit_remove_files; 462 462 } ··· 484 484 struct resource *res; 485 485 int i; 486 486 487 - hwmon_device_unregister(data->class_dev); 487 + hwmon_device_unregister(data->hwmon_dev); 488 488 device_remove_file(&pdev->dev, &dev_attr_name); 489 489 for (i = 0; i < 8; i++) { 490 490 if (!(data->fan_enabled & (1 << i)))
+5 -5
drivers/hwmon/sis5595.c
··· 163 163 struct sis5595_data { 164 164 unsigned short addr; 165 165 const char *name; 166 - struct class_device *class_dev; 166 + struct device *hwmon_dev; 167 167 struct mutex lock; 168 168 169 169 struct mutex update_lock; ··· 557 557 goto exit_remove_files; 558 558 } 559 559 560 - data->class_dev = hwmon_device_register(&pdev->dev); 561 - if (IS_ERR(data->class_dev)) { 562 - err = PTR_ERR(data->class_dev); 560 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 561 + if (IS_ERR(data->hwmon_dev)) { 562 + err = PTR_ERR(data->hwmon_dev); 563 563 goto exit_remove_files; 564 564 } 565 565 ··· 580 580 { 581 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 584 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group); 585 585 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt); 586 586
+5 -5
drivers/hwmon/smsc47b397.c
··· 94 94 struct smsc47b397_data { 95 95 unsigned short addr; 96 96 const char *name; 97 - struct class_device *class_dev; 97 + struct device *hwmon_dev; 98 98 struct mutex lock; 99 99 100 100 struct mutex update_lock; ··· 222 222 struct smsc47b397_data *data = platform_get_drvdata(pdev); 223 223 struct resource *res; 224 224 225 - hwmon_device_unregister(data->class_dev); 225 + hwmon_device_unregister(data->hwmon_dev); 226 226 sysfs_remove_group(&pdev->dev.kobj, &smsc47b397_group); 227 227 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 228 228 release_region(res->start, SMSC_EXTENT); ··· 272 272 if ((err = sysfs_create_group(&dev->kobj, &smsc47b397_group))) 273 273 goto error_free; 274 274 275 - data->class_dev = hwmon_device_register(dev); 276 - if (IS_ERR(data->class_dev)) { 277 - err = PTR_ERR(data->class_dev); 275 + data->hwmon_dev = hwmon_device_register(dev); 276 + if (IS_ERR(data->hwmon_dev)) { 277 + err = PTR_ERR(data->hwmon_dev); 278 278 goto error_remove; 279 279 } 280 280
+5 -5
drivers/hwmon/smsc47m1.c
··· 116 116 unsigned short addr; 117 117 const char *name; 118 118 enum chips type; 119 - struct class_device *class_dev; 119 + struct device *hwmon_dev; 120 120 121 121 struct mutex update_lock; 122 122 unsigned long last_updated; /* In jiffies */ ··· 588 588 if ((err = device_create_file(dev, &dev_attr_name))) 589 589 goto error_remove_files; 590 590 591 - data->class_dev = hwmon_device_register(dev); 592 - if (IS_ERR(data->class_dev)) { 593 - err = PTR_ERR(data->class_dev); 591 + data->hwmon_dev = hwmon_device_register(dev); 592 + if (IS_ERR(data->hwmon_dev)) { 593 + err = PTR_ERR(data->hwmon_dev); 594 594 goto error_remove_files; 595 595 } 596 596 ··· 611 611 struct smsc47m1_data *data = platform_get_drvdata(pdev); 612 612 struct resource *res; 613 613 614 - hwmon_device_unregister(data->class_dev); 614 + hwmon_device_unregister(data->hwmon_dev); 615 615 sysfs_remove_group(&pdev->dev.kobj, &smsc47m1_group); 616 616 617 617 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
+5 -5
drivers/hwmon/smsc47m192.c
··· 97 97 98 98 struct smsc47m192_data { 99 99 struct i2c_client client; 100 - struct class_device *class_dev; 100 + struct device *hwmon_dev; 101 101 struct mutex update_lock; 102 102 char valid; /* !=0 if following fields are valid */ 103 103 unsigned long last_updated; /* In jiffies */ ··· 553 553 goto exit_remove_files; 554 554 } 555 555 556 - data->class_dev = hwmon_device_register(&client->dev); 557 - if (IS_ERR(data->class_dev)) { 558 - err = PTR_ERR(data->class_dev); 556 + data->hwmon_dev = hwmon_device_register(&client->dev); 557 + if (IS_ERR(data->hwmon_dev)) { 558 + err = PTR_ERR(data->hwmon_dev); 559 559 goto exit_remove_files; 560 560 } 561 561 ··· 577 577 struct smsc47m192_data *data = i2c_get_clientdata(client); 578 578 int err; 579 579 580 - hwmon_device_unregister(data->class_dev); 580 + hwmon_device_unregister(data->hwmon_dev); 581 581 sysfs_remove_group(&client->dev.kobj, &smsc47m192_group); 582 582 sysfs_remove_group(&client->dev.kobj, &smsc47m192_group_in4); 583 583
+5 -5
drivers/hwmon/thmc50.c
··· 61 61 /* Each client has this additional data */ 62 62 struct thmc50_data { 63 63 struct i2c_client client; 64 - struct class_device *class_dev; 64 + struct device *hwmon_dev; 65 65 66 66 struct mutex update_lock; 67 67 enum chips type; ··· 351 351 goto exit_remove_sysfs_thmc50; 352 352 353 353 /* Register a new directory entry with module sensors */ 354 - data->class_dev = hwmon_device_register(&client->dev); 355 - if (IS_ERR(data->class_dev)) { 356 - err = PTR_ERR(data->class_dev); 354 + data->hwmon_dev = hwmon_device_register(&client->dev); 355 + if (IS_ERR(data->hwmon_dev)) { 356 + err = PTR_ERR(data->hwmon_dev); 357 357 goto exit_remove_sysfs; 358 358 } 359 359 ··· 384 384 struct thmc50_data *data = i2c_get_clientdata(client); 385 385 int err; 386 386 387 - hwmon_device_unregister(data->class_dev); 387 + hwmon_device_unregister(data->hwmon_dev); 388 388 sysfs_remove_group(&client->dev.kobj, &thmc50_group); 389 389 if (data->type == adm1022) 390 390 sysfs_remove_group(&client->dev.kobj, &adm1022_group);
+5 -5
drivers/hwmon/via686a.c
··· 294 294 struct via686a_data { 295 295 unsigned short addr; 296 296 const char *name; 297 - struct class_device *class_dev; 297 + struct device *hwmon_dev; 298 298 struct mutex update_lock; 299 299 char valid; /* !=0 if following fields are valid */ 300 300 unsigned long last_updated; /* In jiffies */ ··· 627 627 if ((err = sysfs_create_group(&pdev->dev.kobj, &via686a_group))) 628 628 goto exit_free; 629 629 630 - data->class_dev = hwmon_device_register(&pdev->dev); 631 - if (IS_ERR(data->class_dev)) { 632 - err = PTR_ERR(data->class_dev); 630 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 631 + if (IS_ERR(data->hwmon_dev)) { 632 + err = PTR_ERR(data->hwmon_dev); 633 633 goto exit_remove_files; 634 634 } 635 635 ··· 648 648 { 649 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 652 sysfs_remove_group(&pdev->dev.kobj, &via686a_group); 653 653 654 654 release_region(data->addr, VIA686A_EXTENT);
+5 -5
drivers/hwmon/vt1211.c
··· 108 108 struct vt1211_data { 109 109 unsigned short addr; 110 110 const char *name; 111 - struct class_device *class_dev; 111 + struct device *hwmon_dev; 112 112 113 113 struct mutex update_lock; 114 114 char valid; /* !=0 if following fields are valid */ ··· 1191 1191 } 1192 1192 1193 1193 /* Register device */ 1194 - data->class_dev = hwmon_device_register(dev); 1195 - if (IS_ERR(data->class_dev)) { 1196 - err = PTR_ERR(data->class_dev); 1194 + data->hwmon_dev = hwmon_device_register(dev); 1195 + if (IS_ERR(data->hwmon_dev)) { 1196 + err = PTR_ERR(data->hwmon_dev); 1197 1197 dev_err(dev, "Class registration failed (%d)\n", err); 1198 1198 goto EXIT_DEV_REMOVE_SILENT; 1199 1199 } ··· 1217 1217 struct vt1211_data *data = platform_get_drvdata(pdev); 1218 1218 struct resource *res; 1219 1219 1220 - hwmon_device_unregister(data->class_dev); 1220 + hwmon_device_unregister(data->hwmon_dev); 1221 1221 vt1211_remove_sysfs(pdev); 1222 1222 platform_set_drvdata(pdev, NULL); 1223 1223 kfree(data);
+5 -5
drivers/hwmon/vt8231.c
··· 148 148 const char *name; 149 149 150 150 struct mutex update_lock; 151 - struct class_device *class_dev; 151 + struct device *hwmon_dev; 152 152 char valid; /* !=0 if following fields are valid */ 153 153 unsigned long last_updated; /* In jiffies */ 154 154 ··· 726 726 } 727 727 } 728 728 729 - data->class_dev = hwmon_device_register(&pdev->dev); 730 - if (IS_ERR(data->class_dev)) { 731 - err = PTR_ERR(data->class_dev); 729 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 730 + if (IS_ERR(data->hwmon_dev)) { 731 + err = PTR_ERR(data->hwmon_dev); 732 732 goto exit_remove_files; 733 733 } 734 734 return 0; ··· 756 756 struct vt8231_data *data = platform_get_drvdata(pdev); 757 757 int i; 758 758 759 - hwmon_device_unregister(data->class_dev); 759 + hwmon_device_unregister(data->hwmon_dev); 760 760 761 761 for (i = 0; i < ARRAY_SIZE(vt8231_group_volts); i++) 762 762 sysfs_remove_group(&pdev->dev.kobj, &vt8231_group_volts[i]);
+5 -5
drivers/hwmon/w83627ehf.c
··· 256 256 int addr; /* IO base of hw monitor block */ 257 257 const char *name; 258 258 259 - struct class_device *class_dev; 259 + struct device *hwmon_dev; 260 260 struct mutex lock; 261 261 262 262 struct mutex update_lock; ··· 1384 1384 goto exit_remove; 1385 1385 } 1386 1386 1387 - data->class_dev = hwmon_device_register(dev); 1388 - if (IS_ERR(data->class_dev)) { 1389 - err = PTR_ERR(data->class_dev); 1387 + data->hwmon_dev = hwmon_device_register(dev); 1388 + if (IS_ERR(data->hwmon_dev)) { 1389 + err = PTR_ERR(data->hwmon_dev); 1390 1390 goto exit_remove; 1391 1391 } 1392 1392 ··· 1406 1406 { 1407 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 1410 w83627ehf_device_remove_files(&pdev->dev); 1411 1411 release_region(data->addr, IOREGION_LENGTH); 1412 1412 platform_set_drvdata(pdev, NULL);
+5 -5
drivers/hwmon/w83627hf.c
··· 346 346 struct w83627hf_data { 347 347 unsigned short addr; 348 348 const char *name; 349 - struct class_device *class_dev; 349 + struct device *hwmon_dev; 350 350 struct mutex lock; 351 351 enum chips type; 352 352 ··· 1295 1295 || (err = device_create_file(dev, &dev_attr_pwm3_freq))) 1296 1296 goto ERROR4; 1297 1297 1298 - data->class_dev = hwmon_device_register(dev); 1299 - if (IS_ERR(data->class_dev)) { 1300 - err = PTR_ERR(data->class_dev); 1298 + data->hwmon_dev = hwmon_device_register(dev); 1299 + if (IS_ERR(data->hwmon_dev)) { 1300 + err = PTR_ERR(data->hwmon_dev); 1301 1301 goto ERROR4; 1302 1302 } 1303 1303 ··· 1320 1320 struct w83627hf_data *data = platform_get_drvdata(pdev); 1321 1321 struct resource *res; 1322 1322 1323 - hwmon_device_unregister(data->class_dev); 1323 + hwmon_device_unregister(data->hwmon_dev); 1324 1324 1325 1325 sysfs_remove_group(&pdev->dev.kobj, &w83627hf_group); 1326 1326 sysfs_remove_group(&pdev->dev.kobj, &w83627hf_group_opt);
+9 -9
drivers/hwmon/w83781d.c
··· 220 220 the driver field to differentiate between I2C and ISA chips. */ 221 221 struct w83781d_data { 222 222 struct i2c_client client; 223 - struct class_device *class_dev; 223 + struct device *hwmon_dev; 224 224 struct mutex lock; 225 225 enum chips type; 226 226 ··· 1158 1158 if (err) 1159 1159 goto ERROR4; 1160 1160 1161 - data->class_dev = hwmon_device_register(dev); 1162 - if (IS_ERR(data->class_dev)) { 1163 - err = PTR_ERR(data->class_dev); 1161 + data->hwmon_dev = hwmon_device_register(dev); 1162 + if (IS_ERR(data->hwmon_dev)) { 1163 + err = PTR_ERR(data->hwmon_dev); 1164 1164 goto ERROR4; 1165 1165 } 1166 1166 ··· 1194 1194 1195 1195 /* main client */ 1196 1196 if (data) { 1197 - hwmon_device_unregister(data->class_dev); 1197 + hwmon_device_unregister(data->hwmon_dev); 1198 1198 sysfs_remove_group(&client->dev.kobj, &w83781d_group); 1199 1199 sysfs_remove_group(&client->dev.kobj, &w83781d_group_opt); 1200 1200 } ··· 1261 1261 if (err) 1262 1262 goto exit_remove_files; 1263 1263 1264 - data->class_dev = hwmon_device_register(&pdev->dev); 1265 - if (IS_ERR(data->class_dev)) { 1266 - err = PTR_ERR(data->class_dev); 1264 + data->hwmon_dev = hwmon_device_register(&pdev->dev); 1265 + if (IS_ERR(data->hwmon_dev)) { 1266 + err = PTR_ERR(data->hwmon_dev); 1267 1267 goto exit_remove_files; 1268 1268 } 1269 1269 ··· 1285 1285 { 1286 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 1289 sysfs_remove_group(&pdev->dev.kobj, &w83781d_group); 1290 1290 sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt); 1291 1291 device_remove_file(&pdev->dev, &dev_attr_name);
+5 -5
drivers/hwmon/w83791d.c
··· 247 247 248 248 struct w83791d_data { 249 249 struct i2c_client client; 250 - struct class_device *class_dev; 250 + struct device *hwmon_dev; 251 251 struct mutex update_lock; 252 252 253 253 char valid; /* !=0 if following fields are valid */ ··· 1017 1017 goto error3; 1018 1018 1019 1019 /* Everything is ready, now register the working device */ 1020 - data->class_dev = hwmon_device_register(dev); 1021 - if (IS_ERR(data->class_dev)) { 1022 - err = PTR_ERR(data->class_dev); 1020 + data->hwmon_dev = hwmon_device_register(dev); 1021 + if (IS_ERR(data->hwmon_dev)) { 1022 + err = PTR_ERR(data->hwmon_dev); 1023 1023 goto error4; 1024 1024 } 1025 1025 ··· 1051 1051 1052 1052 /* main client */ 1053 1053 if (data) { 1054 - hwmon_device_unregister(data->class_dev); 1054 + hwmon_device_unregister(data->hwmon_dev); 1055 1055 sysfs_remove_group(&client->dev.kobj, &w83791d_group); 1056 1056 } 1057 1057
+5 -5
drivers/hwmon/w83792d.c
··· 267 267 268 268 struct w83792d_data { 269 269 struct i2c_client client; 270 - struct class_device *class_dev; 270 + struct device *hwmon_dev; 271 271 enum chips type; 272 272 273 273 struct mutex update_lock; ··· 1443 1443 &w83792d_group_fan[3]))) 1444 1444 goto exit_remove_files; 1445 1445 1446 - data->class_dev = hwmon_device_register(dev); 1447 - if (IS_ERR(data->class_dev)) { 1448 - err = PTR_ERR(data->class_dev); 1446 + data->hwmon_dev = hwmon_device_register(dev); 1447 + if (IS_ERR(data->hwmon_dev)) { 1448 + err = PTR_ERR(data->hwmon_dev); 1449 1449 goto exit_remove_files; 1450 1450 } 1451 1451 ··· 1480 1480 1481 1481 /* main client */ 1482 1482 if (data) { 1483 - hwmon_device_unregister(data->class_dev); 1483 + hwmon_device_unregister(data->hwmon_dev); 1484 1484 sysfs_remove_group(&client->dev.kobj, &w83792d_group); 1485 1485 for (i = 0; i < ARRAY_SIZE(w83792d_group_fan); i++) 1486 1486 sysfs_remove_group(&client->dev.kobj,
+5 -5
drivers/hwmon/w83793.c
··· 179 179 struct w83793_data { 180 180 struct i2c_client client; 181 181 struct i2c_client *lm75[2]; 182 - struct class_device *class_dev; 182 + struct device *hwmon_dev; 183 183 struct mutex update_lock; 184 184 char valid; /* !=0 if following fields are valid */ 185 185 unsigned long last_updated; /* In jiffies */ ··· 1075 1075 1076 1076 /* main client */ 1077 1077 if (data) { 1078 - hwmon_device_unregister(data->class_dev); 1078 + hwmon_device_unregister(data->hwmon_dev); 1079 1079 1080 1080 for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++) 1081 1081 device_remove_file(dev, ··· 1434 1434 } 1435 1435 } 1436 1436 1437 - data->class_dev = hwmon_device_register(dev); 1438 - if (IS_ERR(data->class_dev)) { 1439 - err = PTR_ERR(data->class_dev); 1437 + data->hwmon_dev = hwmon_device_register(dev); 1438 + if (IS_ERR(data->hwmon_dev)) { 1439 + err = PTR_ERR(data->hwmon_dev); 1440 1440 goto exit_remove; 1441 1441 } 1442 1442
+5 -5
drivers/hwmon/w83l785ts.c
··· 107 107 108 108 struct w83l785ts_data { 109 109 struct i2c_client client; 110 - struct class_device *class_dev; 110 + struct device *hwmon_dev; 111 111 struct mutex update_lock; 112 112 char valid; /* zero until following fields are valid */ 113 113 unsigned long last_updated; /* in jiffies */ ··· 247 247 goto exit_remove; 248 248 249 249 /* Register sysfs hooks */ 250 - data->class_dev = hwmon_device_register(&new_client->dev); 251 - if (IS_ERR(data->class_dev)) { 252 - err = PTR_ERR(data->class_dev); 250 + data->hwmon_dev = hwmon_device_register(&new_client->dev); 251 + if (IS_ERR(data->hwmon_dev)) { 252 + err = PTR_ERR(data->hwmon_dev); 253 253 goto exit_remove; 254 254 } 255 255 ··· 272 272 struct w83l785ts_data *data = i2c_get_clientdata(client); 273 273 int err; 274 274 275 - hwmon_device_unregister(data->class_dev); 275 + hwmon_device_unregister(data->hwmon_dev); 276 276 device_remove_file(&client->dev, 277 277 &sensor_dev_attr_temp1_input.dev_attr); 278 278 device_remove_file(&client->dev,
+2 -2
drivers/input/touchscreen/ads7846.c
··· 83 83 84 84 #if defined(CONFIG_HWMON) || defined(CONFIG_HWMON_MODULE) 85 85 struct attribute_group *attr_group; 86 - struct class_device *hwmon; 86 + struct device *hwmon; 87 87 #endif 88 88 89 89 u16 model; ··· 369 369 370 370 static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts) 371 371 { 372 - struct class_device *hwmon; 372 + struct device *hwmon; 373 373 int err; 374 374 375 375 /* hwmon sensors need a reference voltage */
+1 -1
drivers/misc/thinkpad_acpi.c
··· 517 517 ****************************************************************************/ 518 518 519 519 static struct platform_device *tpacpi_pdev; 520 - static struct class_device *tpacpi_hwmon; 520 + static struct device *tpacpi_hwmon; 521 521 static struct input_dev *tpacpi_inputdev; 522 522 523 523
+1 -1
drivers/misc/thinkpad_acpi.h
··· 171 171 172 172 /* Device model */ 173 173 static struct platform_device *tpacpi_pdev; 174 - static struct class_device *tpacpi_hwmon; 174 + static struct device *tpacpi_hwmon; 175 175 static struct platform_driver tpacpi_pdriver; 176 176 static struct input_dev *tpacpi_inputdev; 177 177 static int tpacpi_create_driver_attributes(struct device_driver *drv);
+2 -2
include/linux/hwmon.h
··· 16 16 17 17 #include <linux/device.h> 18 18 19 - struct class_device *hwmon_device_register(struct device *dev); 19 + struct device *hwmon_device_register(struct device *dev); 20 20 21 - void hwmon_device_unregister(struct class_device *cdev); 21 + void hwmon_device_unregister(struct device *dev); 22 22 23 23 /* Scale user input to sensible values */ 24 24 static inline int SENSORS_LIMIT(long value, long low, long high)