aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorgregkh@suse.de <gregkh@suse.de>2005-03-23 12:53:09 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:08 -0400
commitca8eca6884861c1ce294b05aacfdf9045bba9aff (patch)
treed155207bb52a56683160aa192765a19d67161c01 /drivers/char
parentdeb3697037a7d362d13468a73643e09cbc1615a8 (diff)
[PATCH] class: convert drivers/char/* to use the new class api instead of class_simple
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/dsp56k.c14
-rw-r--r--drivers/char/ftape/zftape/zftape-init.c30
-rw-r--r--drivers/char/ip2main.c24
-rw-r--r--drivers/char/istallion.c10
-rw-r--r--drivers/char/lp.c12
-rw-r--r--drivers/char/mem.c7
-rw-r--r--drivers/char/misc.c16
-rw-r--r--drivers/char/ppdev.c12
-rw-r--r--drivers/char/raw.c18
-rw-r--r--drivers/char/snsc.c7
-rw-r--r--drivers/char/stallion.c10
-rw-r--r--drivers/char/tipar.c14
-rw-r--r--drivers/char/vc_screen.c16
-rw-r--r--drivers/char/viotape.c16
14 files changed, 103 insertions, 103 deletions
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 37d6649011ad..26271e3ca823 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -144,7 +144,7 @@ static struct dsp56k_device {
144 int tx_wsize, rx_wsize; 144 int tx_wsize, rx_wsize;
145} dsp56k; 145} dsp56k;
146 146
147static struct class_simple *dsp56k_class; 147static struct class *dsp56k_class;
148 148
149static int dsp56k_reset(void) 149static int dsp56k_reset(void)
150{ 150{
@@ -510,12 +510,12 @@ static int __init dsp56k_init_driver(void)
510 printk("DSP56k driver: Unable to register driver\n"); 510 printk("DSP56k driver: Unable to register driver\n");
511 return -ENODEV; 511 return -ENODEV;
512 } 512 }
513 dsp56k_class = class_simple_create(THIS_MODULE, "dsp56k"); 513 dsp56k_class = class_create(THIS_MODULE, "dsp56k");
514 if (IS_ERR(dsp56k_class)) { 514 if (IS_ERR(dsp56k_class)) {
515 err = PTR_ERR(dsp56k_class); 515 err = PTR_ERR(dsp56k_class);
516 goto out_chrdev; 516 goto out_chrdev;
517 } 517 }
518 class_simple_device_add(dsp56k_class, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k"); 518 class_device_create(dsp56k_class, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k");
519 519
520 err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0), 520 err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0),
521 S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k"); 521 S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k");
@@ -526,8 +526,8 @@ static int __init dsp56k_init_driver(void)
526 goto out; 526 goto out;
527 527
528out_class: 528out_class:
529 class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0)); 529 class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
530 class_simple_destroy(dsp56k_class); 530 class_destroy(dsp56k_class);
531out_chrdev: 531out_chrdev:
532 unregister_chrdev(DSP56K_MAJOR, "dsp56k"); 532 unregister_chrdev(DSP56K_MAJOR, "dsp56k");
533out: 533out:
@@ -537,8 +537,8 @@ module_init(dsp56k_init_driver);
537 537
538static void __exit dsp56k_cleanup_driver(void) 538static void __exit dsp56k_cleanup_driver(void)
539{ 539{
540 class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0)); 540 class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
541 class_simple_destroy(dsp56k_class); 541 class_destroy(dsp56k_class);
542 unregister_chrdev(DSP56K_MAJOR, "dsp56k"); 542 unregister_chrdev(DSP56K_MAJOR, "dsp56k");
543 devfs_remove("dsp56k"); 543 devfs_remove("dsp56k");
544} 544}
diff --git a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c
index dbac7e54e8e0..5745b74044ec 100644
--- a/drivers/char/ftape/zftape/zftape-init.c
+++ b/drivers/char/ftape/zftape/zftape-init.c
@@ -99,7 +99,7 @@ static struct file_operations zft_cdev =
99 .release = zft_close, 99 .release = zft_close,
100}; 100};
101 101
102static struct class_simple *zft_class; 102static struct class *zft_class;
103 103
104/* Open floppy tape device 104/* Open floppy tape device
105 */ 105 */
@@ -329,29 +329,29 @@ KERN_INFO
329 "installing zftape VFS interface for ftape driver ..."); 329 "installing zftape VFS interface for ftape driver ...");
330 TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),); 330 TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);
331 331
332 zft_class = class_simple_create(THIS_MODULE, "zft"); 332 zft_class = class_create(THIS_MODULE, "zft");
333 for (i = 0; i < 4; i++) { 333 for (i = 0; i < 4; i++) {
334 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i); 334 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i);
335 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i), 335 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i),
336 S_IFCHR | S_IRUSR | S_IWUSR, 336 S_IFCHR | S_IRUSR | S_IWUSR,
337 "qft%i", i); 337 "qft%i", i);
338 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i); 338 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i);
339 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4), 339 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4),
340 S_IFCHR | S_IRUSR | S_IWUSR, 340 S_IFCHR | S_IRUSR | S_IWUSR,
341 "nqft%i", i); 341 "nqft%i", i);
342 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i); 342 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i);
343 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16), 343 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16),
344 S_IFCHR | S_IRUSR | S_IWUSR, 344 S_IFCHR | S_IRUSR | S_IWUSR,
345 "zqft%i", i); 345 "zqft%i", i);
346 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i); 346 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i);
347 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20), 347 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20),
348 S_IFCHR | S_IRUSR | S_IWUSR, 348 S_IFCHR | S_IRUSR | S_IWUSR,
349 "nzqft%i", i); 349 "nzqft%i", i);
350 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i); 350 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i);
351 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32), 351 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32),
352 S_IFCHR | S_IRUSR | S_IWUSR, 352 S_IFCHR | S_IRUSR | S_IWUSR,
353 "rawqft%i", i); 353 "rawqft%i", i);
354 class_simple_device_add(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i); 354 class_device_create(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i);
355 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36), 355 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36),
356 S_IFCHR | S_IRUSR | S_IWUSR, 356 S_IFCHR | S_IRUSR | S_IWUSR,
357 "nrawqft%i", i); 357 "nrawqft%i", i);
@@ -381,19 +381,19 @@ static void zft_exit(void)
381 } 381 }
382 for (i = 0; i < 4; i++) { 382 for (i = 0; i < 4; i++) {
383 devfs_remove("qft%i", i); 383 devfs_remove("qft%i", i);
384 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i)); 384 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i));
385 devfs_remove("nqft%i", i); 385 devfs_remove("nqft%i", i);
386 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 4)); 386 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4));
387 devfs_remove("zqft%i", i); 387 devfs_remove("zqft%i", i);
388 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 16)); 388 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16));
389 devfs_remove("nzqft%i", i); 389 devfs_remove("nzqft%i", i);
390 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 20)); 390 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20));
391 devfs_remove("rawqft%i", i); 391 devfs_remove("rawqft%i", i);
392 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 32)); 392 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32));
393 devfs_remove("nrawqft%i", i); 393 devfs_remove("nrawqft%i", i);
394 class_simple_device_remove(MKDEV(QIC117_TAPE_MAJOR, i + 36)); 394 class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36));
395 } 395 }
396 class_simple_destroy(zft_class); 396 class_destroy(zft_class);
397 zft_uninit_mem(); /* release remaining memory, if any */ 397 zft_uninit_mem(); /* release remaining memory, if any */
398 printk(KERN_INFO "zftape successfully unloaded.\n"); 398 printk(KERN_INFO "zftape successfully unloaded.\n");
399 TRACE_EXIT; 399 TRACE_EXIT;
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index fca9a978fb73..3b8314b4249a 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -302,7 +302,7 @@ static char rirqs[IP2_MAX_BOARDS];
302static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0}; 302static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0};
303 303
304/* for sysfs class support */ 304/* for sysfs class support */
305static struct class_simple *ip2_class; 305static struct class *ip2_class;
306 306
307// Some functions to keep track of what irq's we have 307// Some functions to keep track of what irq's we have
308 308
@@ -414,9 +414,9 @@ cleanup_module(void)
414 iiResetDelay( i2BoardPtrTable[i] ); 414 iiResetDelay( i2BoardPtrTable[i] );
415 /* free io addresses and Tibet */ 415 /* free io addresses and Tibet */
416 release_region( ip2config.addr[i], 8 ); 416 release_region( ip2config.addr[i], 8 );
417 class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 4 * i)); 417 class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i));
418 devfs_remove("ip2/ipl%d", i); 418 devfs_remove("ip2/ipl%d", i);
419 class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 4 * i + 1)); 419 class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
420 devfs_remove("ip2/stat%d", i); 420 devfs_remove("ip2/stat%d", i);
421 } 421 }
422 /* Disable and remove interrupt handler. */ 422 /* Disable and remove interrupt handler. */
@@ -425,7 +425,7 @@ cleanup_module(void)
425 clear_requested_irq( ip2config.irq[i]); 425 clear_requested_irq( ip2config.irq[i]);
426 } 426 }
427 } 427 }
428 class_simple_destroy(ip2_class); 428 class_destroy(ip2_class);
429 devfs_remove("ip2"); 429 devfs_remove("ip2");
430 if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) { 430 if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) {
431 printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err); 431 printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
@@ -700,7 +700,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
700 printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err ); 700 printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err );
701 } else { 701 } else {
702 /* create the sysfs class */ 702 /* create the sysfs class */
703 ip2_class = class_simple_create(THIS_MODULE, "ip2"); 703 ip2_class = class_create(THIS_MODULE, "ip2");
704 if (IS_ERR(ip2_class)) { 704 if (IS_ERR(ip2_class)) {
705 err = PTR_ERR(ip2_class); 705 err = PTR_ERR(ip2_class);
706 goto out_chrdev; 706 goto out_chrdev;
@@ -722,25 +722,25 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
722 } 722 }
723 723
724 if ( NULL != ( pB = i2BoardPtrTable[i] ) ) { 724 if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
725 class_simple_device_add(ip2_class, MKDEV(IP2_IPL_MAJOR, 725 class_device_create(ip2_class, MKDEV(IP2_IPL_MAJOR,
726 4 * i), NULL, "ipl%d", i); 726 4 * i), NULL, "ipl%d", i);
727 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i), 727 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i),
728 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, 728 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
729 "ip2/ipl%d", i); 729 "ip2/ipl%d", i);
730 if (err) { 730 if (err) {
731 class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 731 class_device_destroy(ip2_class,
732 4 * i)); 732 MKDEV(IP2_IPL_MAJOR, 4 * i));
733 goto out_class; 733 goto out_class;
734 } 734 }
735 735
736 class_simple_device_add(ip2_class, MKDEV(IP2_IPL_MAJOR, 736 class_device_create(ip2_class, MKDEV(IP2_IPL_MAJOR,
737 4 * i + 1), NULL, "stat%d", i); 737 4 * i + 1), NULL, "stat%d", i);
738 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1), 738 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
739 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, 739 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
740 "ip2/stat%d", i); 740 "ip2/stat%d", i);
741 if (err) { 741 if (err) {
742 class_simple_device_remove(MKDEV(IP2_IPL_MAJOR, 742 class_device_destroy(ip2_class,
743 4 * i + 1)); 743 MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
744 goto out_class; 744 goto out_class;
745 } 745 }
746 746
@@ -798,7 +798,7 @@ retry:
798 goto out; 798 goto out;
799 799
800out_class: 800out_class:
801 class_simple_destroy(ip2_class); 801 class_destroy(ip2_class);
802out_chrdev: 802out_chrdev:
803 unregister_chrdev(IP2_IPL_MAJOR, "ip2"); 803 unregister_chrdev(IP2_IPL_MAJOR, "ip2");
804out: 804out:
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 21aed0e8779d..c02a21dbad5d 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -792,7 +792,7 @@ static int stli_timeron;
792 792
793/*****************************************************************************/ 793/*****************************************************************************/
794 794
795static struct class_simple *istallion_class; 795static struct class *istallion_class;
796 796
797#ifdef MODULE 797#ifdef MODULE
798 798
@@ -854,10 +854,10 @@ static void __exit istallion_module_exit(void)
854 put_tty_driver(stli_serial); 854 put_tty_driver(stli_serial);
855 for (i = 0; i < 4; i++) { 855 for (i = 0; i < 4; i++) {
856 devfs_remove("staliomem/%d", i); 856 devfs_remove("staliomem/%d", i);
857 class_simple_device_remove(MKDEV(STL_SIOMEMMAJOR, i)); 857 class_device_destroy(istallion_class, MKDEV(STL_SIOMEMMAJOR, i));
858 } 858 }
859 devfs_remove("staliomem"); 859 devfs_remove("staliomem");
860 class_simple_destroy(istallion_class); 860 class_destroy(istallion_class);
861 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) 861 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
862 printk("STALLION: failed to un-register serial memory device, " 862 printk("STALLION: failed to un-register serial memory device, "
863 "errno=%d\n", -i); 863 "errno=%d\n", -i);
@@ -5242,12 +5242,12 @@ int __init stli_init(void)
5242 "device\n"); 5242 "device\n");
5243 5243
5244 devfs_mk_dir("staliomem"); 5244 devfs_mk_dir("staliomem");
5245 istallion_class = class_simple_create(THIS_MODULE, "staliomem"); 5245 istallion_class = class_create(THIS_MODULE, "staliomem");
5246 for (i = 0; i < 4; i++) { 5246 for (i = 0; i < 4; i++) {
5247 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), 5247 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
5248 S_IFCHR | S_IRUSR | S_IWUSR, 5248 S_IFCHR | S_IRUSR | S_IWUSR,
5249 "staliomem/%d", i); 5249 "staliomem/%d", i);
5250 class_simple_device_add(istallion_class, MKDEV(STL_SIOMEMMAJOR, i), 5250 class_device_create(istallion_class, MKDEV(STL_SIOMEMMAJOR, i),
5251 NULL, "staliomem%d", i); 5251 NULL, "staliomem%d", i);
5252 } 5252 }
5253 5253
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 4dee945031d4..59eebe5a035f 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -146,7 +146,7 @@
146static struct lp_struct lp_table[LP_NO]; 146static struct lp_struct lp_table[LP_NO];
147 147
148static unsigned int lp_count = 0; 148static unsigned int lp_count = 0;
149static struct class_simple *lp_class; 149static struct class *lp_class;
150 150
151#ifdef CONFIG_LP_CONSOLE 151#ifdef CONFIG_LP_CONSOLE
152static struct parport *console_registered; // initially NULL 152static struct parport *console_registered; // initially NULL
@@ -804,7 +804,7 @@ static int lp_register(int nr, struct parport *port)
804 if (reset) 804 if (reset)
805 lp_reset(nr); 805 lp_reset(nr);
806 806
807 class_simple_device_add(lp_class, MKDEV(LP_MAJOR, nr), NULL, 807 class_device_create(lp_class, MKDEV(LP_MAJOR, nr), NULL,
808 "lp%d", nr); 808 "lp%d", nr);
809 devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO, 809 devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO,
810 "printers/%d", nr); 810 "printers/%d", nr);
@@ -907,7 +907,7 @@ static int __init lp_init (void)
907 } 907 }
908 908
909 devfs_mk_dir("printers"); 909 devfs_mk_dir("printers");
910 lp_class = class_simple_create(THIS_MODULE, "printer"); 910 lp_class = class_create(THIS_MODULE, "printer");
911 if (IS_ERR(lp_class)) { 911 if (IS_ERR(lp_class)) {
912 err = PTR_ERR(lp_class); 912 err = PTR_ERR(lp_class);
913 goto out_devfs; 913 goto out_devfs;
@@ -930,7 +930,7 @@ static int __init lp_init (void)
930 return 0; 930 return 0;
931 931
932out_class: 932out_class:
933 class_simple_destroy(lp_class); 933 class_destroy(lp_class);
934out_devfs: 934out_devfs:
935 devfs_remove("printers"); 935 devfs_remove("printers");
936 unregister_chrdev(LP_MAJOR, "lp"); 936 unregister_chrdev(LP_MAJOR, "lp");
@@ -981,10 +981,10 @@ static void lp_cleanup_module (void)
981 continue; 981 continue;
982 parport_unregister_device(lp_table[offset].dev); 982 parport_unregister_device(lp_table[offset].dev);
983 devfs_remove("printers/%d", offset); 983 devfs_remove("printers/%d", offset);
984 class_simple_device_remove(MKDEV(LP_MAJOR, offset)); 984 class_device_destroy(lp_class, MKDEV(LP_MAJOR, offset));
985 } 985 }
986 devfs_remove("printers"); 986 devfs_remove("printers");
987 class_simple_destroy(lp_class); 987 class_destroy(lp_class);
988} 988}
989 989
990__setup("lp=", lp_setup); 990__setup("lp=", lp_setup);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 947cb3cef816..257b8ee605e5 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -856,7 +856,7 @@ static const struct {
856 {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops}, 856 {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops},
857}; 857};
858 858
859static struct class_simple *mem_class; 859static struct class *mem_class;
860 860
861static int __init chr_dev_init(void) 861static int __init chr_dev_init(void)
862{ 862{
@@ -865,10 +865,9 @@ static int __init chr_dev_init(void)
865 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) 865 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
866 printk("unable to get major %d for memory devs\n", MEM_MAJOR); 866 printk("unable to get major %d for memory devs\n", MEM_MAJOR);
867 867
868 mem_class = class_simple_create(THIS_MODULE, "mem"); 868 mem_class = class_create(THIS_MODULE, "mem");
869 for (i = 0; i < ARRAY_SIZE(devlist); i++) { 869 for (i = 0; i < ARRAY_SIZE(devlist); i++) {
870 class_simple_device_add(mem_class, 870 class_device_create(mem_class, MKDEV(MEM_MAJOR, devlist[i].minor),
871 MKDEV(MEM_MAJOR, devlist[i].minor),
872 NULL, devlist[i].name); 871 NULL, devlist[i].name);
873 devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor), 872 devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor),
874 S_IFCHR | devlist[i].mode, devlist[i].name); 873 S_IFCHR | devlist[i].mode, devlist[i].name);
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 0937544762da..3115d318b997 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -177,10 +177,10 @@ fail:
177 177
178/* 178/*
179 * TODO for 2.7: 179 * TODO for 2.7:
180 * - add a struct class_device to struct miscdevice and make all usages of 180 * - add a struct kref to struct miscdevice and make all usages of
181 * them dynamic. 181 * them dynamic.
182 */ 182 */
183static struct class_simple *misc_class; 183static struct class *misc_class;
184 184
185static struct file_operations misc_fops = { 185static struct file_operations misc_fops = {
186 .owner = THIS_MODULE, 186 .owner = THIS_MODULE,
@@ -238,8 +238,8 @@ int misc_register(struct miscdevice * misc)
238 } 238 }
239 dev = MKDEV(MISC_MAJOR, misc->minor); 239 dev = MKDEV(MISC_MAJOR, misc->minor);
240 240
241 misc->class = class_simple_device_add(misc_class, dev, 241 misc->class = class_device_create(misc_class, dev, misc->dev,
242 misc->dev, misc->name); 242 "%s", misc->name);
243 if (IS_ERR(misc->class)) { 243 if (IS_ERR(misc->class)) {
244 err = PTR_ERR(misc->class); 244 err = PTR_ERR(misc->class);
245 goto out; 245 goto out;
@@ -248,7 +248,7 @@ int misc_register(struct miscdevice * misc)
248 err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, 248 err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,
249 misc->devfs_name); 249 misc->devfs_name);
250 if (err) { 250 if (err) {
251 class_simple_device_remove(dev); 251 class_device_destroy(misc_class, dev);
252 goto out; 252 goto out;
253 } 253 }
254 254
@@ -281,7 +281,7 @@ int misc_deregister(struct miscdevice * misc)
281 281
282 down(&misc_sem); 282 down(&misc_sem);
283 list_del(&misc->list); 283 list_del(&misc->list);
284 class_simple_device_remove(MKDEV(MISC_MAJOR, misc->minor)); 284 class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
285 devfs_remove(misc->devfs_name); 285 devfs_remove(misc->devfs_name);
286 if (i < DYNAMIC_MINORS && i>0) { 286 if (i < DYNAMIC_MINORS && i>0) {
287 misc_minors[i>>3] &= ~(1 << (misc->minor & 7)); 287 misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
@@ -302,7 +302,7 @@ static int __init misc_init(void)
302 if (ent) 302 if (ent)
303 ent->proc_fops = &misc_proc_fops; 303 ent->proc_fops = &misc_proc_fops;
304#endif 304#endif
305 misc_class = class_simple_create(THIS_MODULE, "misc"); 305 misc_class = class_create(THIS_MODULE, "misc");
306 if (IS_ERR(misc_class)) 306 if (IS_ERR(misc_class))
307 return PTR_ERR(misc_class); 307 return PTR_ERR(misc_class);
308#ifdef CONFIG_MVME16x 308#ifdef CONFIG_MVME16x
@@ -323,7 +323,7 @@ static int __init misc_init(void)
323 if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) { 323 if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
324 printk("unable to get major %d for misc devices\n", 324 printk("unable to get major %d for misc devices\n",
325 MISC_MAJOR); 325 MISC_MAJOR);
326 class_simple_destroy(misc_class); 326 class_destroy(misc_class);
327 return -EIO; 327 return -EIO;
328 } 328 }
329 return 0; 329 return 0;
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 5eda075c62bd..0e22880432bc 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -737,7 +737,7 @@ static unsigned int pp_poll (struct file * file, poll_table * wait)
737 return mask; 737 return mask;
738} 738}
739 739
740static struct class_simple *ppdev_class; 740static struct class *ppdev_class;
741 741
742static struct file_operations pp_fops = { 742static struct file_operations pp_fops = {
743 .owner = THIS_MODULE, 743 .owner = THIS_MODULE,
@@ -752,13 +752,13 @@ static struct file_operations pp_fops = {
752 752
753static void pp_attach(struct parport *port) 753static void pp_attach(struct parport *port)
754{ 754{
755 class_simple_device_add(ppdev_class, MKDEV(PP_MAJOR, port->number), 755 class_device_create(ppdev_class, MKDEV(PP_MAJOR, port->number),
756 NULL, "parport%d", port->number); 756 NULL, "parport%d", port->number);
757} 757}
758 758
759static void pp_detach(struct parport *port) 759static void pp_detach(struct parport *port)
760{ 760{
761 class_simple_device_remove(MKDEV(PP_MAJOR, port->number)); 761 class_device_destroy(ppdev_class, MKDEV(PP_MAJOR, port->number));
762} 762}
763 763
764static struct parport_driver pp_driver = { 764static struct parport_driver pp_driver = {
@@ -776,7 +776,7 @@ static int __init ppdev_init (void)
776 PP_MAJOR); 776 PP_MAJOR);
777 return -EIO; 777 return -EIO;
778 } 778 }
779 ppdev_class = class_simple_create(THIS_MODULE, CHRDEV); 779 ppdev_class = class_create(THIS_MODULE, CHRDEV);
780 if (IS_ERR(ppdev_class)) { 780 if (IS_ERR(ppdev_class)) {
781 err = PTR_ERR(ppdev_class); 781 err = PTR_ERR(ppdev_class);
782 goto out_chrdev; 782 goto out_chrdev;
@@ -798,7 +798,7 @@ out_class:
798 for (i = 0; i < PARPORT_MAX; i++) 798 for (i = 0; i < PARPORT_MAX; i++)
799 devfs_remove("parports/%d", i); 799 devfs_remove("parports/%d", i);
800 devfs_remove("parports"); 800 devfs_remove("parports");
801 class_simple_destroy(ppdev_class); 801 class_destroy(ppdev_class);
802out_chrdev: 802out_chrdev:
803 unregister_chrdev(PP_MAJOR, CHRDEV); 803 unregister_chrdev(PP_MAJOR, CHRDEV);
804out: 804out:
@@ -813,7 +813,7 @@ static void __exit ppdev_cleanup (void)
813 devfs_remove("parports/%d", i); 813 devfs_remove("parports/%d", i);
814 parport_unregister_driver(&pp_driver); 814 parport_unregister_driver(&pp_driver);
815 devfs_remove("parports"); 815 devfs_remove("parports");
816 class_simple_destroy(ppdev_class); 816 class_destroy(ppdev_class);
817 unregister_chrdev (PP_MAJOR, CHRDEV); 817 unregister_chrdev (PP_MAJOR, CHRDEV);
818} 818}
819 819
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index ca5f42bcaad9..f13e5de02207 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -27,7 +27,7 @@ struct raw_device_data {
27 int inuse; 27 int inuse;
28}; 28};
29 29
30static struct class_simple *raw_class; 30static struct class *raw_class;
31static struct raw_device_data raw_devices[MAX_RAW_MINORS]; 31static struct raw_device_data raw_devices[MAX_RAW_MINORS];
32static DECLARE_MUTEX(raw_mutex); 32static DECLARE_MUTEX(raw_mutex);
33static struct file_operations raw_ctl_fops; /* forward declaration */ 33static struct file_operations raw_ctl_fops; /* forward declaration */
@@ -127,8 +127,8 @@ raw_ioctl(struct inode *inode, struct file *filp,
127 127
128static void bind_device(struct raw_config_request *rq) 128static void bind_device(struct raw_config_request *rq)
129{ 129{
130 class_simple_device_remove(MKDEV(RAW_MAJOR, rq->raw_minor)); 130 class_device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor));
131 class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor), 131 class_device_create(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor),
132 NULL, "raw%d", rq->raw_minor); 132 NULL, "raw%d", rq->raw_minor);
133} 133}
134 134
@@ -200,8 +200,8 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
200 if (rq.block_major == 0 && rq.block_minor == 0) { 200 if (rq.block_major == 0 && rq.block_minor == 0) {
201 /* unbind */ 201 /* unbind */
202 rawdev->binding = NULL; 202 rawdev->binding = NULL;
203 class_simple_device_remove(MKDEV(RAW_MAJOR, 203 class_device_destroy(raw_class,
204 rq.raw_minor)); 204 MKDEV(RAW_MAJOR, rq.raw_minor));
205 } else { 205 } else {
206 rawdev->binding = bdget(dev); 206 rawdev->binding = bdget(dev);
207 if (rawdev->binding == NULL) 207 if (rawdev->binding == NULL)
@@ -300,14 +300,14 @@ static int __init raw_init(void)
300 goto error; 300 goto error;
301 } 301 }
302 302
303 raw_class = class_simple_create(THIS_MODULE, "raw"); 303 raw_class = class_create(THIS_MODULE, "raw");
304 if (IS_ERR(raw_class)) { 304 if (IS_ERR(raw_class)) {
305 printk(KERN_ERR "Error creating raw class.\n"); 305 printk(KERN_ERR "Error creating raw class.\n");
306 cdev_del(&raw_cdev); 306 cdev_del(&raw_cdev);
307 unregister_chrdev_region(dev, MAX_RAW_MINORS); 307 unregister_chrdev_region(dev, MAX_RAW_MINORS);
308 goto error; 308 goto error;
309 } 309 }
310 class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); 310 class_device_create(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl");
311 311
312 devfs_mk_cdev(MKDEV(RAW_MAJOR, 0), 312 devfs_mk_cdev(MKDEV(RAW_MAJOR, 0),
313 S_IFCHR | S_IRUGO | S_IWUGO, 313 S_IFCHR | S_IRUGO | S_IWUGO,
@@ -331,8 +331,8 @@ static void __exit raw_exit(void)
331 devfs_remove("raw/raw%d", i); 331 devfs_remove("raw/raw%d", i);
332 devfs_remove("raw/rawctl"); 332 devfs_remove("raw/rawctl");
333 devfs_remove("raw"); 333 devfs_remove("raw");
334 class_simple_device_remove(MKDEV(RAW_MAJOR, 0)); 334 class_device_destroy(raw_class, MKDEV(RAW_MAJOR, 0));
335 class_simple_destroy(raw_class); 335 class_destroy(raw_class);
336 cdev_del(&raw_cdev); 336 cdev_del(&raw_cdev);
337 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); 337 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS);
338} 338}
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index e3c0b52d943f..901d6f173104 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -357,6 +357,8 @@ static struct file_operations scdrv_fops = {
357 .release = scdrv_release, 357 .release = scdrv_release,
358}; 358};
359 359
360static struct class *snsc_class;
361
360/* 362/*
361 * scdrv_init 363 * scdrv_init
362 * 364 *
@@ -372,7 +374,6 @@ scdrv_init(void)
372 char *devnamep; 374 char *devnamep;
373 struct sysctl_data_s *scd; 375 struct sysctl_data_s *scd;
374 void *salbuf; 376 void *salbuf;
375 struct class_simple *snsc_class;
376 dev_t first_dev, dev; 377 dev_t first_dev, dev;
377 nasid_t event_nasid = ia64_sn_get_console_nasid(); 378 nasid_t event_nasid = ia64_sn_get_console_nasid();
378 379
@@ -382,7 +383,7 @@ scdrv_init(void)
382 __FUNCTION__); 383 __FUNCTION__);
383 return -ENODEV; 384 return -ENODEV;
384 } 385 }
385 snsc_class = class_simple_create(THIS_MODULE, SYSCTL_BASENAME); 386 snsc_class = class_create(THIS_MODULE, SYSCTL_BASENAME);
386 387
387 for (cnode = 0; cnode < numionodes; cnode++) { 388 for (cnode = 0; cnode < numionodes; cnode++) {
388 geoid = cnodeid_get_geoid(cnode); 389 geoid = cnodeid_get_geoid(cnode);
@@ -436,7 +437,7 @@ scdrv_init(void)
436 continue; 437 continue;
437 } 438 }
438 439
439 class_simple_device_add(snsc_class, dev, NULL, 440 class__device_create(snsc_class, dev, NULL,
440 "%s", devname); 441 "%s", devname);
441 442
442 ia64_sn_irtr_intr_enable(scd->scd_nasid, 443 ia64_sn_irtr_intr_enable(scd->scd_nasid,
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index b8899f560b5e..951545a6ef2d 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -719,7 +719,7 @@ static struct file_operations stl_fsiomem = {
719 719
720/*****************************************************************************/ 720/*****************************************************************************/
721 721
722static struct class_simple *stallion_class; 722static struct class *stallion_class;
723 723
724/* 724/*
725 * Loadable module initialization stuff. 725 * Loadable module initialization stuff.
@@ -777,13 +777,13 @@ static void __exit stallion_module_exit(void)
777 } 777 }
778 for (i = 0; i < 4; i++) { 778 for (i = 0; i < 4; i++) {
779 devfs_remove("staliomem/%d", i); 779 devfs_remove("staliomem/%d", i);
780 class_simple_device_remove(MKDEV(STL_SIOMEMMAJOR, i)); 780 class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
781 } 781 }
782 devfs_remove("staliomem"); 782 devfs_remove("staliomem");
783 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) 783 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
784 printk("STALLION: failed to un-register serial memory device, " 784 printk("STALLION: failed to un-register serial memory device, "
785 "errno=%d\n", -i); 785 "errno=%d\n", -i);
786 class_simple_destroy(stallion_class); 786 class_destroy(stallion_class);
787 787
788 if (stl_tmpwritebuf != (char *) NULL) 788 if (stl_tmpwritebuf != (char *) NULL)
789 kfree(stl_tmpwritebuf); 789 kfree(stl_tmpwritebuf);
@@ -3090,12 +3090,12 @@ static int __init stl_init(void)
3090 printk("STALLION: failed to register serial board device\n"); 3090 printk("STALLION: failed to register serial board device\n");
3091 devfs_mk_dir("staliomem"); 3091 devfs_mk_dir("staliomem");
3092 3092
3093 stallion_class = class_simple_create(THIS_MODULE, "staliomem"); 3093 stallion_class = class_create(THIS_MODULE, "staliomem");
3094 for (i = 0; i < 4; i++) { 3094 for (i = 0; i < 4; i++) {
3095 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), 3095 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
3096 S_IFCHR|S_IRUSR|S_IWUSR, 3096 S_IFCHR|S_IRUSR|S_IWUSR,
3097 "staliomem/%d", i); 3097 "staliomem/%d", i);
3098 class_simple_device_add(stallion_class, MKDEV(STL_SIOMEMMAJOR, i), NULL, "staliomem%d", i); 3098 class_device_create(stallion_class, MKDEV(STL_SIOMEMMAJOR, i), NULL, "staliomem%d", i);
3099 } 3099 }
3100 3100
3101 stl_serial->owner = THIS_MODULE; 3101 stl_serial->owner = THIS_MODULE;
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index 0c5ba9dc9063..659335d80ee7 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -90,7 +90,7 @@ static int timeout = TIMAXTIME; /* timeout in tenth of seconds */
90static unsigned int tp_count; /* tipar count */ 90static unsigned int tp_count; /* tipar count */
91static unsigned long opened; /* opened devices */ 91static unsigned long opened; /* opened devices */
92 92
93static struct class_simple *tipar_class; 93static struct class *tipar_class;
94 94
95/* --- macros for parport access -------------------------------------- */ 95/* --- macros for parport access -------------------------------------- */
96 96
@@ -436,7 +436,7 @@ tipar_register(int nr, struct parport *port)
436 goto out; 436 goto out;
437 } 437 }
438 438
439 class_simple_device_add(tipar_class, MKDEV(TIPAR_MAJOR, 439 class_device_create(tipar_class, MKDEV(TIPAR_MAJOR,
440 TIPAR_MINOR + nr), NULL, "par%d", nr); 440 TIPAR_MINOR + nr), NULL, "par%d", nr);
441 /* Use devfs, tree: /dev/ticables/par/[0..2] */ 441 /* Use devfs, tree: /dev/ticables/par/[0..2] */
442 err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr), 442 err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr),
@@ -458,8 +458,8 @@ tipar_register(int nr, struct parport *port)
458 goto out; 458 goto out;
459 459
460out_class: 460out_class:
461 class_simple_device_remove(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr)); 461 class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr));
462 class_simple_destroy(tipar_class); 462 class_destroy(tipar_class);
463out: 463out:
464 return err; 464 return err;
465} 465}
@@ -505,7 +505,7 @@ tipar_init_module(void)
505 /* Use devfs with tree: /dev/ticables/par/[0..2] */ 505 /* Use devfs with tree: /dev/ticables/par/[0..2] */
506 devfs_mk_dir("ticables/par"); 506 devfs_mk_dir("ticables/par");
507 507
508 tipar_class = class_simple_create(THIS_MODULE, "ticables"); 508 tipar_class = class_create(THIS_MODULE, "ticables");
509 if (IS_ERR(tipar_class)) { 509 if (IS_ERR(tipar_class)) {
510 err = PTR_ERR(tipar_class); 510 err = PTR_ERR(tipar_class);
511 goto out_chrdev; 511 goto out_chrdev;
@@ -539,10 +539,10 @@ tipar_cleanup_module(void)
539 if (table[i].dev == NULL) 539 if (table[i].dev == NULL)
540 continue; 540 continue;
541 parport_unregister_device(table[i].dev); 541 parport_unregister_device(table[i].dev);
542 class_simple_device_remove(MKDEV(TIPAR_MAJOR, i)); 542 class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, i));
543 devfs_remove("ticables/par/%d", i); 543 devfs_remove("ticables/par/%d", i);
544 } 544 }
545 class_simple_destroy(tipar_class); 545 class_destroy(tipar_class);
546 devfs_remove("ticables/par"); 546 devfs_remove("ticables/par");
547 547
548 pr_info("tipar: module unloaded\n"); 548 pr_info("tipar: module unloaded\n");
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index 7abe405b8657..79c2928a8817 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -474,7 +474,7 @@ static struct file_operations vcs_fops = {
474 .open = vcs_open, 474 .open = vcs_open,
475}; 475};
476 476
477static struct class_simple *vc_class; 477static struct class *vc_class;
478 478
479void vcs_make_devfs(struct tty_struct *tty) 479void vcs_make_devfs(struct tty_struct *tty)
480{ 480{
@@ -484,26 +484,26 @@ void vcs_make_devfs(struct tty_struct *tty)
484 devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129), 484 devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129),
485 S_IFCHR|S_IRUSR|S_IWUSR, 485 S_IFCHR|S_IRUSR|S_IWUSR,
486 "vcc/a%u", tty->index + 1); 486 "vcc/a%u", tty->index + 1);
487 class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, tty->index + 1), NULL, "vcs%u", tty->index + 1); 487 class_device_create(vc_class, MKDEV(VCS_MAJOR, tty->index + 1), NULL, "vcs%u", tty->index + 1);
488 class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, tty->index + 129), NULL, "vcsa%u", tty->index + 1); 488 class_device_create(vc_class, MKDEV(VCS_MAJOR, tty->index + 129), NULL, "vcsa%u", tty->index + 1);
489} 489}
490void vcs_remove_devfs(struct tty_struct *tty) 490void vcs_remove_devfs(struct tty_struct *tty)
491{ 491{
492 devfs_remove("vcc/%u", tty->index + 1); 492 devfs_remove("vcc/%u", tty->index + 1);
493 devfs_remove("vcc/a%u", tty->index + 1); 493 devfs_remove("vcc/a%u", tty->index + 1);
494 class_simple_device_remove(MKDEV(VCS_MAJOR, tty->index + 1)); 494 class_device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 1));
495 class_simple_device_remove(MKDEV(VCS_MAJOR, tty->index + 129)); 495 class_device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 129));
496} 496}
497 497
498int __init vcs_init(void) 498int __init vcs_init(void)
499{ 499{
500 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops)) 500 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops))
501 panic("unable to get major %d for vcs device", VCS_MAJOR); 501 panic("unable to get major %d for vcs device", VCS_MAJOR);
502 vc_class = class_simple_create(THIS_MODULE, "vc"); 502 vc_class = class_create(THIS_MODULE, "vc");
503 503
504 devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0"); 504 devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0");
505 devfs_mk_cdev(MKDEV(VCS_MAJOR, 128), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/a0"); 505 devfs_mk_cdev(MKDEV(VCS_MAJOR, 128), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/a0");
506 class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); 506 class_device_create(vc_class, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
507 class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); 507 class_device_create(vc_class, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
508 return 0; 508 return 0;
509} 509}
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index aea3cbf5219d..4764b4f9555d 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -237,7 +237,7 @@ static dma_addr_t viotape_unitinfo_token;
237 237
238static struct mtget viomtget[VIOTAPE_MAX_TAPE]; 238static struct mtget viomtget[VIOTAPE_MAX_TAPE];
239 239
240static struct class_simple *tape_class; 240static struct class *tape_class;
241 241
242static struct device *tape_device[VIOTAPE_MAX_TAPE]; 242static struct device *tape_device[VIOTAPE_MAX_TAPE];
243 243
@@ -956,9 +956,9 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
956 state[i].cur_part = 0; 956 state[i].cur_part = 0;
957 for (j = 0; j < MAX_PARTITIONS; ++j) 957 for (j = 0; j < MAX_PARTITIONS; ++j)
958 state[i].part_stat_rwi[j] = VIOT_IDLE; 958 state[i].part_stat_rwi[j] = VIOT_IDLE;
959 class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i), NULL, 959 class_device_create(tape_class, MKDEV(VIOTAPE_MAJOR, i), NULL,
960 "iseries!vt%d", i); 960 "iseries!vt%d", i);
961 class_simple_device_add(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80), 961 class_device_create(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80),
962 NULL, "iseries!nvt%d", i); 962 NULL, "iseries!nvt%d", i);
963 devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR, 963 devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR,
964 "iseries/vt%d", i); 964 "iseries/vt%d", i);
@@ -980,8 +980,8 @@ static int viotape_remove(struct vio_dev *vdev)
980 devfs_remove("iseries/nvt%d", i); 980 devfs_remove("iseries/nvt%d", i);
981 devfs_remove("iseries/vt%d", i); 981 devfs_remove("iseries/vt%d", i);
982 devfs_unregister_tape(state[i].dev_handle); 982 devfs_unregister_tape(state[i].dev_handle);
983 class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i | 0x80)); 983 class_device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80));
984 class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i)); 984 class_device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i));
985 return 0; 985 return 0;
986} 986}
987 987
@@ -1045,7 +1045,7 @@ int __init viotap_init(void)
1045 goto clear_handler; 1045 goto clear_handler;
1046 } 1046 }
1047 1047
1048 tape_class = class_simple_create(THIS_MODULE, "tape"); 1048 tape_class = class_create(THIS_MODULE, "tape");
1049 if (IS_ERR(tape_class)) { 1049 if (IS_ERR(tape_class)) {
1050 printk(VIOTAPE_KERN_WARN "Unable to allocat class\n"); 1050 printk(VIOTAPE_KERN_WARN "Unable to allocat class\n");
1051 ret = PTR_ERR(tape_class); 1051 ret = PTR_ERR(tape_class);
@@ -1070,7 +1070,7 @@ int __init viotap_init(void)
1070 return 0; 1070 return 0;
1071 1071
1072unreg_class: 1072unreg_class:
1073 class_simple_destroy(tape_class); 1073 class_destroy(tape_class);
1074unreg_chrdev: 1074unreg_chrdev:
1075 unregister_chrdev(VIOTAPE_MAJOR, "viotape"); 1075 unregister_chrdev(VIOTAPE_MAJOR, "viotape");
1076clear_handler: 1076clear_handler:
@@ -1110,7 +1110,7 @@ static void __exit viotap_exit(void)
1110 1110
1111 remove_proc_entry("iSeries/viotape", NULL); 1111 remove_proc_entry("iSeries/viotape", NULL);
1112 vio_unregister_driver(&viotape_driver); 1112 vio_unregister_driver(&viotape_driver);
1113 class_simple_destroy(tape_class); 1113 class_destroy(tape_class);
1114 ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape"); 1114 ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape");
1115 if (ret < 0) 1115 if (ret < 0)
1116 printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n", 1116 printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n",