aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ip2main.c
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/ip2main.c
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/ip2main.c')
-rw-r--r--drivers/char/ip2main.c24
1 files changed, 12 insertions, 12 deletions
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: