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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index d94cd8410c53..15e597d03002 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3412,7 +3412,7 @@ struct device *tty_register_device(struct tty_driver *driver, unsigned index,
3412 else 3412 else
3413 tty_line_name(driver, index, name); 3413 tty_line_name(driver, index, name);
3414 3414
3415 return device_create(tty_class, device, dev, name); 3415 return device_create_drvdata(tty_class, device, dev, NULL, name);
3416} 3416}
3417 3417
3418/** 3418/**
@@ -3690,20 +3690,22 @@ static int __init tty_init(void)
3690 if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) || 3690 if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) ||
3691 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) 3691 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)
3692 panic("Couldn't register /dev/tty driver\n"); 3692 panic("Couldn't register /dev/tty driver\n");
3693 device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), "tty"); 3693 device_create_drvdata(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL,
3694 "tty");
3694 3695
3695 cdev_init(&console_cdev, &console_fops); 3696 cdev_init(&console_cdev, &console_fops);
3696 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || 3697 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) ||
3697 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) 3698 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
3698 panic("Couldn't register /dev/console driver\n"); 3699 panic("Couldn't register /dev/console driver\n");
3699 device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), "console"); 3700 device_create_drvdata(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL,
3701 "console");
3700 3702
3701#ifdef CONFIG_UNIX98_PTYS 3703#ifdef CONFIG_UNIX98_PTYS
3702 cdev_init(&ptmx_cdev, &ptmx_fops); 3704 cdev_init(&ptmx_cdev, &ptmx_fops);
3703 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || 3705 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
3704 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) 3706 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)
3705 panic("Couldn't register /dev/ptmx driver\n"); 3707 panic("Couldn't register /dev/ptmx driver\n");
3706 device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), "ptmx"); 3708 device_create_drvdata(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx");
3707#endif 3709#endif
3708 3710
3709#ifdef CONFIG_VT 3711#ifdef CONFIG_VT
@@ -3711,7 +3713,7 @@ static int __init tty_init(void)
3711 if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) || 3713 if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
3712 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) 3714 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
3713 panic("Couldn't register /dev/tty0 driver\n"); 3715 panic("Couldn't register /dev/tty0 driver\n");
3714 device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), "tty0"); 3716 device_create_drvdata(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
3715 3717
3716 vty_init(); 3718 vty_init();
3717#endif 3719#endif