summaryrefslogtreecommitdiffstats
path: root/drivers/char/ppdev.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /drivers/char/ppdev.c
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (diff)
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'drivers/char/ppdev.c')
-rw-r--r--drivers/char/ppdev.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 6a6ff8081..d73c09695 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -45,6 +45,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
+#include <linux/devfs_fs_kernel.h>
#include <linux/ioctl.h>
#include <linux/parport.h>
#include <linux/ctype.h>
@@ -579,13 +580,20 @@ static struct file_operations pp_fops = {
release: pp_release,
};
+static devfs_handle_t devfs_handle = NULL;
+
static int __init ppdev_init (void)
{
- if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
+ if (devfs_register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
printk (KERN_WARNING CHRDEV ": unable to get major %d\n",
PP_MAJOR);
return -EIO;
}
+ devfs_handle = devfs_mk_dir (NULL, "parports", 0, NULL);
+ devfs_register_series (devfs_handle, "%u", PARPORT_MAX,
+ DEVFS_FL_DEFAULT, PP_MAJOR, 0,
+ S_IFCHR | S_IRUGO | S_IWUGO, 0, 0,
+ &pp_fops, NULL);
printk (KERN_INFO PP_VERSION "\n");
return 0;
@@ -594,7 +602,8 @@ static int __init ppdev_init (void)
static void __exit ppdev_cleanup (void)
{
/* Clean up all parport stuff */
- unregister_chrdev (PP_MAJOR, CHRDEV);
+ devfs_unregister (devfs_handle);
+ devfs_unregister_chrdev (PP_MAJOR, CHRDEV);
}
module_init(ppdev_init);