X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fchar%2Ftipar.c;h=d30dc09dbbc9df2ffbb5c09e8f3cb32e334a49e2;hb=59458f40e25915a355d8b1d701425fe9f4f9ea23;hp=eb2eb3e12d6a0ed07a48046e0df136a504342470;hpb=9585da3729e7e27bf22818625c10ac6c64ebb609;p=powerpc.git diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c index eb2eb3e12d..d30dc09dbb 100644 --- a/drivers/char/tipar.c +++ b/drivers/char/tipar.c @@ -42,7 +42,6 @@ */ #undef DEBUG /* change to #define to get debugging * output - for pr_debug() */ -#include #include #include #include @@ -56,7 +55,6 @@ #include #include #include -#include /* DevFs support */ #include /* Our code depend on parport */ #include @@ -383,7 +381,7 @@ tipar_ioctl(struct inode *inode, struct file *file, /* ----- kernel module registering ------------------------------------ */ -static struct file_operations tipar_fops = { +static const struct file_operations tipar_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = tipar_read, @@ -443,12 +441,6 @@ tipar_register(int nr, struct parport *port) class_device_create(tipar_class, NULL, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr), NULL, "par%d", nr); - /* Use devfs, tree: /dev/ticables/par/[0..2] */ - err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr), - S_IFCHR | S_IRUGO | S_IWUGO, - "ticables/par/%d", nr); - if (err) - goto out_class; /* Display informations */ pr_info("tipar%d: using %s (%s)\n", nr, port->name, (port->irq == @@ -460,11 +452,7 @@ tipar_register(int nr, struct parport *port) pr_info("tipar%d: link cable not found\n", nr); err = 0; - goto out; -out_class: - class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr)); - class_destroy(tipar_class); out: return err; } @@ -507,15 +495,12 @@ tipar_init_module(void) goto out; } - /* Use devfs with tree: /dev/ticables/par/[0..2] */ - devfs_mk_dir("ticables/par"); - tipar_class = class_create(THIS_MODULE, "ticables"); if (IS_ERR(tipar_class)) { err = PTR_ERR(tipar_class); goto out_chrdev; } - if (parport_register_driver(&tipar_driver) || tp_count == 0) { + if (parport_register_driver(&tipar_driver)) { printk(KERN_ERR "tipar: unable to register with parport\n"); err = -EIO; goto out_class; @@ -528,7 +513,6 @@ out_class: class_destroy(tipar_class); out_chrdev: - devfs_remove("ticables/par"); unregister_chrdev(TIPAR_MAJOR, "tipar"); out: return err; @@ -549,10 +533,8 @@ tipar_cleanup_module(void) continue; parport_unregister_device(table[i].dev); class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, i)); - devfs_remove("ticables/par/%d", i); } class_destroy(tipar_class); - devfs_remove("ticables/par"); pr_info("tipar: module unloaded\n"); }