Commit ca8eca6884861c1ce294b05aacfdf9045bba9aff

Authored by gregkh@suse.de
Committed by Greg Kroah-Hartman
1 parent deb3697037

[PATCH] class: convert drivers/char/* to use the new class api instead of class_simple

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 14 changed files with 103 additions and 103 deletions Side-by-side Diff

drivers/char/dsp56k.c
... ... @@ -144,7 +144,7 @@
144 144 int tx_wsize, rx_wsize;
145 145 } dsp56k;
146 146  
147   -static struct class_simple *dsp56k_class;
  147 +static struct class *dsp56k_class;
148 148  
149 149 static int dsp56k_reset(void)
150 150 {
151 151  
... ... @@ -510,12 +510,12 @@
510 510 printk("DSP56k driver: Unable to register driver\n");
511 511 return -ENODEV;
512 512 }
513   - dsp56k_class = class_simple_create(THIS_MODULE, "dsp56k");
  513 + dsp56k_class = class_create(THIS_MODULE, "dsp56k");
514 514 if (IS_ERR(dsp56k_class)) {
515 515 err = PTR_ERR(dsp56k_class);
516 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 520 err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0),
521 521 S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k");
... ... @@ -526,8 +526,8 @@
526 526 goto out;
527 527  
528 528 out_class:
529   - class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0));
530   - class_simple_destroy(dsp56k_class);
  529 + class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
  530 + class_destroy(dsp56k_class);
531 531 out_chrdev:
532 532 unregister_chrdev(DSP56K_MAJOR, "dsp56k");
533 533 out:
... ... @@ -537,8 +537,8 @@
537 537  
538 538 static void __exit dsp56k_cleanup_driver(void)
539 539 {
540   - class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0));
541   - class_simple_destroy(dsp56k_class);
  540 + class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
  541 + class_destroy(dsp56k_class);
542 542 unregister_chrdev(DSP56K_MAJOR, "dsp56k");
543 543 devfs_remove("dsp56k");
544 544 }
drivers/char/ftape/zftape/zftape-init.c
... ... @@ -99,7 +99,7 @@
99 99 .release = zft_close,
100 100 };
101 101  
102   -static struct class_simple *zft_class;
  102 +static struct class *zft_class;
103 103  
104 104 /* Open floppy tape device
105 105 */
106 106  
107 107  
108 108  
109 109  
110 110  
111 111  
... ... @@ -329,29 +329,29 @@
329 329 "installing zftape VFS interface for ftape driver ...");
330 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 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 335 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i),
336 336 S_IFCHR | S_IRUSR | S_IWUSR,
337 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 339 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4),
340 340 S_IFCHR | S_IRUSR | S_IWUSR,
341 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 343 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16),
344 344 S_IFCHR | S_IRUSR | S_IWUSR,
345 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 347 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20),
348 348 S_IFCHR | S_IRUSR | S_IWUSR,
349 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 351 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32),
352 352 S_IFCHR | S_IRUSR | S_IWUSR,
353 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 355 devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36),
356 356 S_IFCHR | S_IRUSR | S_IWUSR,
357 357 "nrawqft%i", i);
358 358  
359 359  
360 360  
361 361  
362 362  
363 363  
... ... @@ -381,19 +381,19 @@
381 381 }
382 382 for (i = 0; i < 4; i++) {
383 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 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 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 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 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 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 397 zft_uninit_mem(); /* release remaining memory, if any */
398 398 printk(KERN_INFO "zftape successfully unloaded.\n");
399 399 TRACE_EXIT;
drivers/char/ip2main.c
... ... @@ -302,7 +302,7 @@
302 302 static int Valid_Irqs[] = { 3, 4, 5, 7, 10, 11, 12, 15, 0};
303 303  
304 304 /* for sysfs class support */
305   -static struct class_simple *ip2_class;
  305 +static struct class *ip2_class;
306 306  
307 307 // Some functions to keep track of what irq's we have
308 308  
309 309  
... ... @@ -414,9 +414,9 @@
414 414 iiResetDelay( i2BoardPtrTable[i] );
415 415 /* free io addresses and Tibet */
416 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 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 420 devfs_remove("ip2/stat%d", i);
421 421 }
422 422 /* Disable and remove interrupt handler. */
... ... @@ -425,7 +425,7 @@
425 425 clear_requested_irq( ip2config.irq[i]);
426 426 }
427 427 }
428   - class_simple_destroy(ip2_class);
  428 + class_destroy(ip2_class);
429 429 devfs_remove("ip2");
430 430 if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) {
431 431 printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
... ... @@ -700,7 +700,7 @@
700 700 printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err );
701 701 } else {
702 702 /* create the sysfs class */
703   - ip2_class = class_simple_create(THIS_MODULE, "ip2");
  703 + ip2_class = class_create(THIS_MODULE, "ip2");
704 704 if (IS_ERR(ip2_class)) {
705 705 err = PTR_ERR(ip2_class);
706 706 goto out_chrdev;
707 707  
708 708  
709 709  
... ... @@ -722,25 +722,25 @@
722 722 }
723 723  
724 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 726 4 * i), NULL, "ipl%d", i);
727 727 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i),
728 728 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
729 729 "ip2/ipl%d", i);
730 730 if (err) {
731   - class_simple_device_remove(MKDEV(IP2_IPL_MAJOR,
732   - 4 * i));
  731 + class_device_destroy(ip2_class,
  732 + MKDEV(IP2_IPL_MAJOR, 4 * i));
733 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 737 4 * i + 1), NULL, "stat%d", i);
738 738 err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
739 739 S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
740 740 "ip2/stat%d", i);
741 741 if (err) {
742   - class_simple_device_remove(MKDEV(IP2_IPL_MAJOR,
743   - 4 * i + 1));
  742 + class_device_destroy(ip2_class,
  743 + MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
744 744 goto out_class;
745 745 }
746 746  
... ... @@ -798,7 +798,7 @@
798 798 goto out;
799 799  
800 800 out_class:
801   - class_simple_destroy(ip2_class);
  801 + class_destroy(ip2_class);
802 802 out_chrdev:
803 803 unregister_chrdev(IP2_IPL_MAJOR, "ip2");
804 804 out:
drivers/char/istallion.c
... ... @@ -792,7 +792,7 @@
792 792  
793 793 /*****************************************************************************/
794 794  
795   -static struct class_simple *istallion_class;
  795 +static struct class *istallion_class;
796 796  
797 797 #ifdef MODULE
798 798  
799 799  
... ... @@ -854,10 +854,10 @@
854 854 put_tty_driver(stli_serial);
855 855 for (i = 0; i < 4; i++) {
856 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 859 devfs_remove("staliomem");
860   - class_simple_destroy(istallion_class);
  860 + class_destroy(istallion_class);
861 861 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
862 862 printk("STALLION: failed to un-register serial memory device, "
863 863 "errno=%d\n", -i);
864 864  
... ... @@ -5242,12 +5242,12 @@
5242 5242 "device\n");
5243 5243  
5244 5244 devfs_mk_dir("staliomem");
5245   - istallion_class = class_simple_create(THIS_MODULE, "staliomem");
  5245 + istallion_class = class_create(THIS_MODULE, "staliomem");
5246 5246 for (i = 0; i < 4; i++) {
5247 5247 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
5248 5248 S_IFCHR | S_IRUSR | S_IWUSR,
5249 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 5251 NULL, "staliomem%d", i);
5252 5252 }
5253 5253  
... ... @@ -146,7 +146,7 @@
146 146 static struct lp_struct lp_table[LP_NO];
147 147  
148 148 static unsigned int lp_count = 0;
149   -static struct class_simple *lp_class;
  149 +static struct class *lp_class;
150 150  
151 151 #ifdef CONFIG_LP_CONSOLE
152 152 static struct parport *console_registered; // initially NULL
... ... @@ -804,7 +804,7 @@
804 804 if (reset)
805 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 808 "lp%d", nr);
809 809 devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO,
810 810 "printers/%d", nr);
... ... @@ -907,7 +907,7 @@
907 907 }
908 908  
909 909 devfs_mk_dir("printers");
910   - lp_class = class_simple_create(THIS_MODULE, "printer");
  910 + lp_class = class_create(THIS_MODULE, "printer");
911 911 if (IS_ERR(lp_class)) {
912 912 err = PTR_ERR(lp_class);
913 913 goto out_devfs;
... ... @@ -930,7 +930,7 @@
930 930 return 0;
931 931  
932 932 out_class:
933   - class_simple_destroy(lp_class);
  933 + class_destroy(lp_class);
934 934 out_devfs:
935 935 devfs_remove("printers");
936 936 unregister_chrdev(LP_MAJOR, "lp");
937 937  
... ... @@ -981,10 +981,10 @@
981 981 continue;
982 982 parport_unregister_device(lp_table[offset].dev);
983 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 986 devfs_remove("printers");
987   - class_simple_destroy(lp_class);
  987 + class_destroy(lp_class);
988 988 }
989 989  
990 990 __setup("lp=", lp_setup);
... ... @@ -856,7 +856,7 @@
856 856 {11,"kmsg", S_IRUGO | S_IWUSR, &kmsg_fops},
857 857 };
858 858  
859   -static struct class_simple *mem_class;
  859 +static struct class *mem_class;
860 860  
861 861 static int __init chr_dev_init(void)
862 862 {
863 863  
... ... @@ -865,10 +865,9 @@
865 865 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
866 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 869 for (i = 0; i < ARRAY_SIZE(devlist); i++) {
870   - class_simple_device_add(mem_class,
871   - MKDEV(MEM_MAJOR, devlist[i].minor),
  870 + class_device_create(mem_class, MKDEV(MEM_MAJOR, devlist[i].minor),
872 871 NULL, devlist[i].name);
873 872 devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor),
874 873 S_IFCHR | devlist[i].mode, devlist[i].name);
... ... @@ -177,10 +177,10 @@
177 177  
178 178 /*
179 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 181 * them dynamic.
182 182 */
183   -static struct class_simple *misc_class;
  183 +static struct class *misc_class;
184 184  
185 185 static struct file_operations misc_fops = {
186 186 .owner = THIS_MODULE,
... ... @@ -238,8 +238,8 @@
238 238 }
239 239 dev = MKDEV(MISC_MAJOR, misc->minor);
240 240  
241   - misc->class = class_simple_device_add(misc_class, dev,
242   - misc->dev, misc->name);
  241 + misc->class = class_device_create(misc_class, dev, misc->dev,
  242 + "%s", misc->name);
243 243 if (IS_ERR(misc->class)) {
244 244 err = PTR_ERR(misc->class);
245 245 goto out;
... ... @@ -248,7 +248,7 @@
248 248 err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,
249 249 misc->devfs_name);
250 250 if (err) {
251   - class_simple_device_remove(dev);
  251 + class_device_destroy(misc_class, dev);
252 252 goto out;
253 253 }
254 254  
... ... @@ -281,7 +281,7 @@
281 281  
282 282 down(&misc_sem);
283 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 285 devfs_remove(misc->devfs_name);
286 286 if (i < DYNAMIC_MINORS && i>0) {
287 287 misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
... ... @@ -302,7 +302,7 @@
302 302 if (ent)
303 303 ent->proc_fops = &misc_proc_fops;
304 304 #endif
305   - misc_class = class_simple_create(THIS_MODULE, "misc");
  305 + misc_class = class_create(THIS_MODULE, "misc");
306 306 if (IS_ERR(misc_class))
307 307 return PTR_ERR(misc_class);
308 308 #ifdef CONFIG_MVME16x
... ... @@ -323,7 +323,7 @@
323 323 if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
324 324 printk("unable to get major %d for misc devices\n",
325 325 MISC_MAJOR);
326   - class_simple_destroy(misc_class);
  326 + class_destroy(misc_class);
327 327 return -EIO;
328 328 }
329 329 return 0;
drivers/char/ppdev.c
... ... @@ -737,7 +737,7 @@
737 737 return mask;
738 738 }
739 739  
740   -static struct class_simple *ppdev_class;
  740 +static struct class *ppdev_class;
741 741  
742 742 static struct file_operations pp_fops = {
743 743 .owner = THIS_MODULE,
744 744  
... ... @@ -752,13 +752,13 @@
752 752  
753 753 static 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 756 NULL, "parport%d", port->number);
757 757 }
758 758  
759 759 static 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  
764 764 static struct parport_driver pp_driver = {
... ... @@ -776,7 +776,7 @@
776 776 PP_MAJOR);
777 777 return -EIO;
778 778 }
779   - ppdev_class = class_simple_create(THIS_MODULE, CHRDEV);
  779 + ppdev_class = class_create(THIS_MODULE, CHRDEV);
780 780 if (IS_ERR(ppdev_class)) {
781 781 err = PTR_ERR(ppdev_class);
782 782 goto out_chrdev;
... ... @@ -798,7 +798,7 @@
798 798 for (i = 0; i < PARPORT_MAX; i++)
799 799 devfs_remove("parports/%d", i);
800 800 devfs_remove("parports");
801   - class_simple_destroy(ppdev_class);
  801 + class_destroy(ppdev_class);
802 802 out_chrdev:
803 803 unregister_chrdev(PP_MAJOR, CHRDEV);
804 804 out:
... ... @@ -813,7 +813,7 @@
813 813 devfs_remove("parports/%d", i);
814 814 parport_unregister_driver(&pp_driver);
815 815 devfs_remove("parports");
816   - class_simple_destroy(ppdev_class);
  816 + class_destroy(ppdev_class);
817 817 unregister_chrdev (PP_MAJOR, CHRDEV);
818 818 }
819 819  
... ... @@ -27,7 +27,7 @@
27 27 int inuse;
28 28 };
29 29  
30   -static struct class_simple *raw_class;
  30 +static struct class *raw_class;
31 31 static struct raw_device_data raw_devices[MAX_RAW_MINORS];
32 32 static DECLARE_MUTEX(raw_mutex);
33 33 static struct file_operations raw_ctl_fops; /* forward declaration */
... ... @@ -127,8 +127,8 @@
127 127  
128 128 static void bind_device(struct raw_config_request *rq)
129 129 {
130   - class_simple_device_remove(MKDEV(RAW_MAJOR, rq->raw_minor));
131   - class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor),
  130 + class_device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor));
  131 + class_device_create(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor),
132 132 NULL, "raw%d", rq->raw_minor);
133 133 }
134 134  
... ... @@ -200,8 +200,8 @@
200 200 if (rq.block_major == 0 && rq.block_minor == 0) {
201 201 /* unbind */
202 202 rawdev->binding = NULL;
203   - class_simple_device_remove(MKDEV(RAW_MAJOR,
204   - rq.raw_minor));
  203 + class_device_destroy(raw_class,
  204 + MKDEV(RAW_MAJOR, rq.raw_minor));
205 205 } else {
206 206 rawdev->binding = bdget(dev);
207 207 if (rawdev->binding == NULL)
208 208  
... ... @@ -300,14 +300,14 @@
300 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 304 if (IS_ERR(raw_class)) {
305 305 printk(KERN_ERR "Error creating raw class.\n");
306 306 cdev_del(&raw_cdev);
307 307 unregister_chrdev_region(dev, MAX_RAW_MINORS);
308 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 312 devfs_mk_cdev(MKDEV(RAW_MAJOR, 0),
313 313 S_IFCHR | S_IRUGO | S_IWUGO,
... ... @@ -331,8 +331,8 @@
331 331 devfs_remove("raw/raw%d", i);
332 332 devfs_remove("raw/rawctl");
333 333 devfs_remove("raw");
334   - class_simple_device_remove(MKDEV(RAW_MAJOR, 0));
335   - class_simple_destroy(raw_class);
  334 + class_device_destroy(raw_class, MKDEV(RAW_MAJOR, 0));
  335 + class_destroy(raw_class);
336 336 cdev_del(&raw_cdev);
337 337 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS);
338 338 }
... ... @@ -357,6 +357,8 @@
357 357 .release = scdrv_release,
358 358 };
359 359  
  360 +static struct class *snsc_class;
  361 +
360 362 /*
361 363 * scdrv_init
362 364 *
... ... @@ -372,7 +374,6 @@
372 374 char *devnamep;
373 375 struct sysctl_data_s *scd;
374 376 void *salbuf;
375   - struct class_simple *snsc_class;
376 377 dev_t first_dev, dev;
377 378 nasid_t event_nasid = ia64_sn_get_console_nasid();
378 379  
... ... @@ -382,7 +383,7 @@
382 383 __FUNCTION__);
383 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 388 for (cnode = 0; cnode < numionodes; cnode++) {
388 389 geoid = cnodeid_get_geoid(cnode);
... ... @@ -436,7 +437,7 @@
436 437 continue;
437 438 }
438 439  
439   - class_simple_device_add(snsc_class, dev, NULL,
  440 + class__device_create(snsc_class, dev, NULL,
440 441 "%s", devname);
441 442  
442 443 ia64_sn_irtr_intr_enable(scd->scd_nasid,
drivers/char/stallion.c
... ... @@ -719,7 +719,7 @@
719 719  
720 720 /*****************************************************************************/
721 721  
722   -static struct class_simple *stallion_class;
  722 +static struct class *stallion_class;
723 723  
724 724 /*
725 725 * Loadable module initialization stuff.
726 726  
... ... @@ -777,13 +777,13 @@
777 777 }
778 778 for (i = 0; i < 4; i++) {
779 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 782 devfs_remove("staliomem");
783 783 if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
784 784 printk("STALLION: failed to un-register serial memory device, "
785 785 "errno=%d\n", -i);
786   - class_simple_destroy(stallion_class);
  786 + class_destroy(stallion_class);
787 787  
788 788 if (stl_tmpwritebuf != (char *) NULL)
789 789 kfree(stl_tmpwritebuf);
790 790  
... ... @@ -3090,12 +3090,12 @@
3090 3090 printk("STALLION: failed to register serial board device\n");
3091 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 3094 for (i = 0; i < 4; i++) {
3095 3095 devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
3096 3096 S_IFCHR|S_IRUSR|S_IWUSR,
3097 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 3101 stl_serial->owner = THIS_MODULE;
drivers/char/tipar.c
... ... @@ -90,7 +90,7 @@
90 90 static unsigned int tp_count; /* tipar count */
91 91 static unsigned long opened; /* opened devices */
92 92  
93   -static struct class_simple *tipar_class;
  93 +static struct class *tipar_class;
94 94  
95 95 /* --- macros for parport access -------------------------------------- */
96 96  
... ... @@ -436,7 +436,7 @@
436 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 440 TIPAR_MINOR + nr), NULL, "par%d", nr);
441 441 /* Use devfs, tree: /dev/ticables/par/[0..2] */
442 442 err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr),
... ... @@ -458,8 +458,8 @@
458 458 goto out;
459 459  
460 460 out_class:
461   - class_simple_device_remove(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr));
462   - class_simple_destroy(tipar_class);
  461 + class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr));
  462 + class_destroy(tipar_class);
463 463 out:
464 464 return err;
465 465 }
... ... @@ -505,7 +505,7 @@
505 505 /* Use devfs with tree: /dev/ticables/par/[0..2] */
506 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 509 if (IS_ERR(tipar_class)) {
510 510 err = PTR_ERR(tipar_class);
511 511 goto out_chrdev;
512 512  
... ... @@ -539,10 +539,10 @@
539 539 if (table[i].dev == NULL)
540 540 continue;
541 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 543 devfs_remove("ticables/par/%d", i);
544 544 }
545   - class_simple_destroy(tipar_class);
  545 + class_destroy(tipar_class);
546 546 devfs_remove("ticables/par");
547 547  
548 548 pr_info("tipar: module unloaded\n");
drivers/char/vc_screen.c
... ... @@ -474,7 +474,7 @@
474 474 .open = vcs_open,
475 475 };
476 476  
477   -static struct class_simple *vc_class;
  477 +static struct class *vc_class;
478 478  
479 479 void vcs_make_devfs(struct tty_struct *tty)
480 480 {
481 481  
482 482  
483 483  
... ... @@ -484,27 +484,27 @@
484 484 devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129),
485 485 S_IFCHR|S_IRUSR|S_IWUSR,
486 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);
488   - class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, tty->index + 129), NULL, "vcsa%u", tty->index + 1);
  487 + class_device_create(vc_class, MKDEV(VCS_MAJOR, tty->index + 1), NULL, "vcs%u", tty->index + 1);
  488 + class_device_create(vc_class, MKDEV(VCS_MAJOR, tty->index + 129), NULL, "vcsa%u", tty->index + 1);
489 489 }
490 490 void vcs_remove_devfs(struct tty_struct *tty)
491 491 {
492 492 devfs_remove("vcc/%u", tty->index + 1);
493 493 devfs_remove("vcc/a%u", tty->index + 1);
494   - class_simple_device_remove(MKDEV(VCS_MAJOR, tty->index + 1));
495   - class_simple_device_remove(MKDEV(VCS_MAJOR, tty->index + 129));
  494 + class_device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 1));
  495 + class_device_destroy(vc_class, MKDEV(VCS_MAJOR, tty->index + 129));
496 496 }
497 497  
498 498 int __init vcs_init(void)
499 499 {
500 500 if (register_chrdev(VCS_MAJOR, "vcs", &vcs_fops))
501 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 504 devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0");
505 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");
507   - class_simple_device_add(vc_class, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
  506 + class_device_create(vc_class, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
  507 + class_device_create(vc_class, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
508 508 return 0;
509 509 }
drivers/char/viotape.c
... ... @@ -237,7 +237,7 @@
237 237  
238 238 static struct mtget viomtget[VIOTAPE_MAX_TAPE];
239 239  
240   -static struct class_simple *tape_class;
  240 +static struct class *tape_class;
241 241  
242 242 static struct device *tape_device[VIOTAPE_MAX_TAPE];
243 243  
244 244  
... ... @@ -956,9 +956,9 @@
956 956 state[i].cur_part = 0;
957 957 for (j = 0; j < MAX_PARTITIONS; ++j)
958 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 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 962 NULL, "iseries!nvt%d", i);
963 963 devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR,
964 964 "iseries/vt%d", i);
... ... @@ -980,8 +980,8 @@
980 980 devfs_remove("iseries/nvt%d", i);
981 981 devfs_remove("iseries/vt%d", i);
982 982 devfs_unregister_tape(state[i].dev_handle);
983   - class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i | 0x80));
984   - class_simple_device_remove(MKDEV(VIOTAPE_MAJOR, i));
  983 + class_device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80));
  984 + class_device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i));
985 985 return 0;
986 986 }
987 987  
... ... @@ -1045,7 +1045,7 @@
1045 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 1049 if (IS_ERR(tape_class)) {
1050 1050 printk(VIOTAPE_KERN_WARN "Unable to allocat class\n");
1051 1051 ret = PTR_ERR(tape_class);
... ... @@ -1070,7 +1070,7 @@
1070 1070 return 0;
1071 1071  
1072 1072 unreg_class:
1073   - class_simple_destroy(tape_class);
  1073 + class_destroy(tape_class);
1074 1074 unreg_chrdev:
1075 1075 unregister_chrdev(VIOTAPE_MAJOR, "viotape");
1076 1076 clear_handler:
... ... @@ -1110,7 +1110,7 @@
1110 1110  
1111 1111 remove_proc_entry("iSeries/viotape", NULL);
1112 1112 vio_unregister_driver(&viotape_driver);
1113   - class_simple_destroy(tape_class);
  1113 + class_destroy(tape_class);
1114 1114 ret = unregister_chrdev(VIOTAPE_MAJOR, "viotape");
1115 1115 if (ret < 0)
1116 1116 printk(VIOTAPE_KERN_WARN "Error unregistering device: %d\n",