Commit e2d115ec authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ppdev cleanup

	switched to explicit devfs_register()/devfs_remove(), killed gratitious
devfs_handle_t variables.
parent 39211e86
...@@ -749,8 +749,6 @@ static struct file_operations pp_fops = { ...@@ -749,8 +749,6 @@ static struct file_operations pp_fops = {
.release = pp_release, .release = pp_release,
}; };
static devfs_handle_t devfs_handle;
static int __init ppdev_init (void) static int __init ppdev_init (void)
{ {
if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) { if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
...@@ -758,11 +756,13 @@ static int __init ppdev_init (void) ...@@ -758,11 +756,13 @@ static int __init ppdev_init (void)
PP_MAJOR); PP_MAJOR);
return -EIO; return -EIO;
} }
devfs_handle = devfs_mk_dir (NULL, "parports", NULL); devfs_mk_dir (NULL, "parports", NULL);
devfs_register_series (devfs_handle, "%u", PARPORT_MAX, for (i = 0; i < PARPORT_MAX; i++) {
DEVFS_FL_DEFAULT, PP_MAJOR, 0, char name[16];
S_IFCHR | S_IRUGO | S_IWUGO, sprintf(name, "parports/%d", i);
&pp_fops, NULL); devfs_register(NULL, name, DEVFS_FL_DEFAULT, PP_MAJOR, i,
S_IFCHR | S_IRUGO | S_IWUGO, &pp_fops, NULL);
}
printk (KERN_INFO PP_VERSION "\n"); printk (KERN_INFO PP_VERSION "\n");
return 0; return 0;
...@@ -770,8 +770,11 @@ static int __init ppdev_init (void) ...@@ -770,8 +770,11 @@ static int __init ppdev_init (void)
static void __exit ppdev_cleanup (void) static void __exit ppdev_cleanup (void)
{ {
int i;
/* Clean up all parport stuff */ /* Clean up all parport stuff */
devfs_unregister (devfs_handle); for (i = 0; i < PARPORT_MAX; i++)
devfs_remove("parports/%d", i);
devfs_remove("parports");
unregister_chrdev (PP_MAJOR, CHRDEV); unregister_chrdev (PP_MAJOR, CHRDEV);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment