aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 8d19f7281f0b..a1143238feca 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -102,7 +102,6 @@
102#include <linux/kbd_kern.h> 102#include <linux/kbd_kern.h>
103#include <linux/vt_kern.h> 103#include <linux/vt_kern.h>
104#include <linux/selection.h> 104#include <linux/selection.h>
105#include <linux/devfs_fs_kernel.h>
106 105
107#include <linux/kmod.h> 106#include <linux/kmod.h>
108 107
@@ -2955,8 +2954,8 @@ static struct class *tty_class;
2955 * Returns a pointer to the class device (or ERR_PTR(-EFOO) on error). 2954 * Returns a pointer to the class device (or ERR_PTR(-EFOO) on error).
2956 * 2955 *
2957 * This call is required to be made to register an individual tty device if 2956 * This call is required to be made to register an individual tty device if
2958 * the tty driver's flags have the TTY_DRIVER_NO_DEVFS bit set. If that 2957 * the tty driver's flags have the TTY_DRIVER_DYNAMIC_DEV bit set. If that
2959 * bit is not set, this function should not be called. 2958 * bit is not set, this function should not be called by a tty driver.
2960 */ 2959 */
2961struct class_device *tty_register_device(struct tty_driver *driver, 2960struct class_device *tty_register_device(struct tty_driver *driver,
2962 unsigned index, struct device *device) 2961 unsigned index, struct device *device)
@@ -2970,9 +2969,6 @@ struct class_device *tty_register_device(struct tty_driver *driver,
2970 return ERR_PTR(-EINVAL); 2969 return ERR_PTR(-EINVAL);
2971 } 2970 }
2972 2971
2973 devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
2974 "%s%d", driver->devfs_name, index + driver->name_base);
2975
2976 if (driver->type == TTY_DRIVER_TYPE_PTY) 2972 if (driver->type == TTY_DRIVER_TYPE_PTY)
2977 pty_line_name(driver, index, name); 2973 pty_line_name(driver, index, name);
2978 else 2974 else
@@ -2991,7 +2987,6 @@ struct class_device *tty_register_device(struct tty_driver *driver,
2991 */ 2987 */
2992void tty_unregister_device(struct tty_driver *driver, unsigned index) 2988void tty_unregister_device(struct tty_driver *driver, unsigned index)
2993{ 2989{
2994 devfs_remove("%s%d", driver->devfs_name, index + driver->name_base);
2995 class_device_destroy(tty_class, MKDEV(driver->major, driver->minor_start) + index); 2990 class_device_destroy(tty_class, MKDEV(driver->major, driver->minor_start) + index);
2996} 2991}
2997 2992
@@ -3113,7 +3108,7 @@ int tty_register_driver(struct tty_driver *driver)
3113 3108
3114 list_add(&driver->tty_drivers, &tty_drivers); 3109 list_add(&driver->tty_drivers, &tty_drivers);
3115 3110
3116 if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) { 3111 if ( !(driver->flags & TTY_DRIVER_DYNAMIC_DEV) ) {
3117 for(i = 0; i < driver->num; i++) 3112 for(i = 0; i < driver->num; i++)
3118 tty_register_device(driver, i, NULL); 3113 tty_register_device(driver, i, NULL);
3119 } 3114 }
@@ -3156,7 +3151,7 @@ int tty_unregister_driver(struct tty_driver *driver)
3156 driver->termios_locked[i] = NULL; 3151 driver->termios_locked[i] = NULL;
3157 kfree(tp); 3152 kfree(tp);
3158 } 3153 }
3159 if (!(driver->flags & TTY_DRIVER_NO_DEVFS)) 3154 if (!(driver->flags & TTY_DRIVER_DYNAMIC_DEV))
3160 tty_unregister_device(driver, i); 3155 tty_unregister_device(driver, i);
3161 } 3156 }
3162 p = driver->ttys; 3157 p = driver->ttys;
@@ -3232,14 +3227,12 @@ static int __init tty_init(void)
3232 if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) || 3227 if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) ||
3233 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) 3228 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)
3234 panic("Couldn't register /dev/tty driver\n"); 3229 panic("Couldn't register /dev/tty driver\n");
3235 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty");
3236 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); 3230 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty");
3237 3231
3238 cdev_init(&console_cdev, &console_fops); 3232 cdev_init(&console_cdev, &console_fops);
3239 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || 3233 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) ||
3240 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) 3234 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
3241 panic("Couldn't register /dev/console driver\n"); 3235 panic("Couldn't register /dev/console driver\n");
3242 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console");
3243 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); 3236 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL, "console");
3244 3237
3245#ifdef CONFIG_UNIX98_PTYS 3238#ifdef CONFIG_UNIX98_PTYS
@@ -3247,7 +3240,6 @@ static int __init tty_init(void)
3247 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || 3240 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
3248 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) 3241 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)
3249 panic("Couldn't register /dev/ptmx driver\n"); 3242 panic("Couldn't register /dev/ptmx driver\n");
3250 devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx");
3251 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); 3243 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx");
3252#endif 3244#endif
3253 3245
@@ -3256,7 +3248,6 @@ static int __init tty_init(void)
3256 if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) || 3248 if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
3257 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) 3249 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
3258 panic("Couldn't register /dev/tty0 driver\n"); 3250 panic("Couldn't register /dev/tty0 driver\n");
3259 devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0");
3260 class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0"); 3251 class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
3261 3252
3262 vty_init(); 3253 vty_init();