aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/paride/pg.c')
-rw-r--r--drivers/block/paride/pg.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index 79b868254032..13f998aa1cd3 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -156,7 +156,6 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_DLY};
156#include <linux/module.h> 156#include <linux/module.h>
157#include <linux/init.h> 157#include <linux/init.h>
158#include <linux/fs.h> 158#include <linux/fs.h>
159#include <linux/devfs_fs_kernel.h>
160#include <linux/delay.h> 159#include <linux/delay.h>
161#include <linux/slab.h> 160#include <linux/slab.h>
162#include <linux/mtio.h> 161#include <linux/mtio.h>
@@ -674,25 +673,15 @@ static int __init pg_init(void)
674 err = PTR_ERR(pg_class); 673 err = PTR_ERR(pg_class);
675 goto out_chrdev; 674 goto out_chrdev;
676 } 675 }
677 devfs_mk_dir("pg");
678 for (unit = 0; unit < PG_UNITS; unit++) { 676 for (unit = 0; unit < PG_UNITS; unit++) {
679 struct pg *dev = &devices[unit]; 677 struct pg *dev = &devices[unit];
680 if (dev->present) { 678 if (dev->present)
681 class_device_create(pg_class, NULL, MKDEV(major, unit), 679 class_device_create(pg_class, NULL, MKDEV(major, unit),
682 NULL, "pg%u", unit); 680 NULL, "pg%u", unit);
683 err = devfs_mk_cdev(MKDEV(major, unit),
684 S_IFCHR | S_IRUSR | S_IWUSR, "pg/%u",
685 unit);
686 if (err)
687 goto out_class;
688 }
689 } 681 }
690 err = 0; 682 err = 0;
691 goto out; 683 goto out;
692 684
693out_class:
694 class_device_destroy(pg_class, MKDEV(major, unit));
695 class_destroy(pg_class);
696out_chrdev: 685out_chrdev:
697 unregister_chrdev(major, "pg"); 686 unregister_chrdev(major, "pg");
698out: 687out:
@@ -705,13 +694,10 @@ static void __exit pg_exit(void)
705 694
706 for (unit = 0; unit < PG_UNITS; unit++) { 695 for (unit = 0; unit < PG_UNITS; unit++) {
707 struct pg *dev = &devices[unit]; 696 struct pg *dev = &devices[unit];
708 if (dev->present) { 697 if (dev->present)
709 class_device_destroy(pg_class, MKDEV(major, unit)); 698 class_device_destroy(pg_class, MKDEV(major, unit));
710 devfs_remove("pg/%u", unit);
711 }
712 } 699 }
713 class_destroy(pg_class); 700 class_destroy(pg_class);
714 devfs_remove("pg");
715 unregister_chrdev(major, name); 701 unregister_chrdev(major, name);
716 702
717 for (unit = 0; unit < PG_UNITS; unit++) { 703 for (unit = 0; unit < PG_UNITS; unit++) {