X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fchar%2Fppdev.c;h=520d2cf82bc0ca74edbe00b834288cfdd022ec8d;hb=1678df37be8abbb381becdc40242ed915e775550;hp=0e22880432bca3d8c89be8c7b0a6ffabbd05fc03;hpb=a8b3e6f10f08f66ae1072efd087b30966a3654f6;p=powerpc.git diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 0e22880432..520d2cf82b 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c @@ -60,15 +60,15 @@ #include #include #include -#include #include #include #include #include -#include +#include #include #include #include +#include #define PP_VERSION "ppdev: user-space parallel port driver" #define CHRDEV "ppdev" @@ -739,7 +739,7 @@ static unsigned int pp_poll (struct file * file, poll_table * wait) static struct class *ppdev_class; -static struct file_operations pp_fops = { +static const struct file_operations pp_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = pp_read, @@ -752,7 +752,7 @@ static struct file_operations pp_fops = { static void pp_attach(struct parport *port) { - class_device_create(ppdev_class, MKDEV(PP_MAJOR, port->number), + class_device_create(ppdev_class, NULL, MKDEV(PP_MAJOR, port->number), NULL, "parport%d", port->number); } @@ -769,7 +769,7 @@ static struct parport_driver pp_driver = { static int __init ppdev_init (void) { - int i, err = 0; + int err = 0; if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) { printk (KERN_WARNING CHRDEV ": unable to get major %d\n", @@ -781,11 +781,6 @@ static int __init ppdev_init (void) err = PTR_ERR(ppdev_class); goto out_chrdev; } - devfs_mk_dir("parports"); - for (i = 0; i < PARPORT_MAX; i++) { - devfs_mk_cdev(MKDEV(PP_MAJOR, i), - S_IFCHR | S_IRUGO | S_IWUGO, "parports/%d", i); - } if (parport_register_driver(&pp_driver)) { printk (KERN_WARNING CHRDEV ": unable to register with parport\n"); goto out_class; @@ -795,9 +790,6 @@ static int __init ppdev_init (void) goto out; out_class: - for (i = 0; i < PARPORT_MAX; i++) - devfs_remove("parports/%d", i); - devfs_remove("parports"); class_destroy(ppdev_class); out_chrdev: unregister_chrdev(PP_MAJOR, CHRDEV); @@ -807,12 +799,8 @@ out: static void __exit ppdev_cleanup (void) { - int i; /* Clean up all parport stuff */ - for (i = 0; i < PARPORT_MAX; i++) - devfs_remove("parports/%d", i); parport_unregister_driver(&pp_driver); - devfs_remove("parports"); class_destroy(ppdev_class); unregister_chrdev (PP_MAJOR, CHRDEV); }