X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fchar%2Flp.c;h=1ecea7d448f14618e19112b6c84dd75a25c25d7d;hb=bde0d2c98bcfc9acc83ac79c33a6ac1335b95a92;hp=2afb9038dbc5752abbdf55dc1dc3c8a9737bd841;hpb=c85b2a5fe200d744a814d23c258460d4fc98a546;p=linux-2.6-omap-h63xx.git diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 2afb9038dbc..1ecea7d448f 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -114,13 +114,11 @@ #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -668,7 +666,7 @@ static int lp_ioctl(struct inode *inode, struct file *file, return retval; } -static struct file_operations lp_fops = { +static const struct file_operations lp_fops = { .owner = THIS_MODULE, .write = lp_write, .ioctl = lp_ioctl, @@ -805,10 +803,8 @@ static int lp_register(int nr, struct parport *port) if (reset) lp_reset(nr); - class_device_create(lp_class, MKDEV(LP_MAJOR, nr), NULL, + class_device_create(lp_class, NULL, MKDEV(LP_MAJOR, nr), NULL, "lp%d", nr); - devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO, - "printers/%d", nr); printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name, (port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven"); @@ -907,11 +903,10 @@ static int __init lp_init (void) return -EIO; } - devfs_mk_dir("printers"); lp_class = class_create(THIS_MODULE, "printer"); if (IS_ERR(lp_class)) { err = PTR_ERR(lp_class); - goto out_devfs; + goto out_reg; } if (parport_register_driver (&lp_driver)) { @@ -932,8 +927,7 @@ static int __init lp_init (void) out_class: class_destroy(lp_class); -out_devfs: - devfs_remove("printers"); +out_reg: unregister_chrdev(LP_MAJOR, "lp"); return err; } @@ -981,10 +975,8 @@ static void lp_cleanup_module (void) if (lp_table[offset].dev == NULL) continue; parport_unregister_device(lp_table[offset].dev); - devfs_remove("printers/%d", offset); class_device_destroy(lp_class, MKDEV(LP_MAJOR, offset)); } - devfs_remove("printers"); class_destroy(lp_class); }