X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fchar%2Ftty_io.c;h=bfdb90242a905749021bc93a801cb543e969852c;hb=58a5b0a6346b71bf01f0d49cfcc91d3225a373aa;hp=8d19f7281f0b4b1bab12b801b8ff141e349bd495;hpb=fffcb480e4224f25c965b93fa65541bfc7dd732e;p=powerpc.git diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 8d19f7281f..bfdb90242a 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -65,7 +65,6 @@ * alloc_tty_struct() always uses kmalloc() -- Andrew Morton 17Mar01 */ -#include #include #include #include @@ -102,7 +101,6 @@ #include #include #include -#include #include @@ -914,7 +912,7 @@ static int hung_up_tty_ioctl(struct inode * inode, struct file * file, return cmd == TIOCSPGRP ? -ENOTTY : -EIO; } -static struct file_operations tty_fops = { +static const struct file_operations tty_fops = { .llseek = no_llseek, .read = tty_read, .write = tty_write, @@ -926,7 +924,7 @@ static struct file_operations tty_fops = { }; #ifdef CONFIG_UNIX98_PTYS -static struct file_operations ptmx_fops = { +static const struct file_operations ptmx_fops = { .llseek = no_llseek, .read = tty_read, .write = tty_write, @@ -938,7 +936,7 @@ static struct file_operations ptmx_fops = { }; #endif -static struct file_operations console_fops = { +static const struct file_operations console_fops = { .llseek = no_llseek, .read = tty_read, .write = redirected_tty_write, @@ -949,7 +947,7 @@ static struct file_operations console_fops = { .fasync = tty_fasync, }; -static struct file_operations hung_up_tty_fops = { +static const struct file_operations hung_up_tty_fops = { .llseek = no_llseek, .read = hung_up_tty_read, .write = hung_up_tty_write, @@ -2338,7 +2336,7 @@ static int fionbio(struct file *file, int __user *p) static int tiocsctty(struct tty_struct *tty, int arg) { - task_t *p; + struct task_struct *p; if (current->signal->leader && (current->signal->session == tty->session)) @@ -2955,8 +2953,8 @@ static struct class *tty_class; * Returns a pointer to the class device (or ERR_PTR(-EFOO) on error). * * This call is required to be made to register an individual tty device if - * the tty driver's flags have the TTY_DRIVER_NO_DEVFS bit set. If that - * bit is not set, this function should not be called. + * the tty driver's flags have the TTY_DRIVER_DYNAMIC_DEV bit set. If that + * bit is not set, this function should not be called by a tty driver. */ struct class_device *tty_register_device(struct tty_driver *driver, unsigned index, struct device *device) @@ -2970,9 +2968,6 @@ struct class_device *tty_register_device(struct tty_driver *driver, return ERR_PTR(-EINVAL); } - devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR, - "%s%d", driver->devfs_name, index + driver->name_base); - if (driver->type == TTY_DRIVER_TYPE_PTY) pty_line_name(driver, index, name); else @@ -2991,7 +2986,6 @@ struct class_device *tty_register_device(struct tty_driver *driver, */ void tty_unregister_device(struct tty_driver *driver, unsigned index) { - devfs_remove("%s%d", driver->devfs_name, index + driver->name_base); class_device_destroy(tty_class, MKDEV(driver->major, driver->minor_start) + index); } @@ -3113,7 +3107,7 @@ int tty_register_driver(struct tty_driver *driver) list_add(&driver->tty_drivers, &tty_drivers); - if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) { + if ( !(driver->flags & TTY_DRIVER_DYNAMIC_DEV) ) { for(i = 0; i < driver->num; i++) tty_register_device(driver, i, NULL); } @@ -3156,7 +3150,7 @@ int tty_unregister_driver(struct tty_driver *driver) driver->termios_locked[i] = NULL; kfree(tp); } - if (!(driver->flags & TTY_DRIVER_NO_DEVFS)) + if (!(driver->flags & TTY_DRIVER_DYNAMIC_DEV)) tty_unregister_device(driver, i); } p = driver->ttys; @@ -3232,14 +3226,12 @@ static int __init tty_init(void) if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) panic("Couldn't register /dev/tty driver\n"); - devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty"); class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); cdev_init(&console_cdev, &console_fops); if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) panic("Couldn't register /dev/console driver\n"); - devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console"); class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); #ifdef CONFIG_UNIX98_PTYS @@ -3247,7 +3239,6 @@ static int __init tty_init(void) if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) panic("Couldn't register /dev/ptmx driver\n"); - devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx"); class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); #endif @@ -3256,7 +3247,6 @@ static int __init tty_init(void) if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) || register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) panic("Couldn't register /dev/tty0 driver\n"); - devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0"); class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0"); vty_init();