TTY: move cdev_add to tty_register_device
authorJiri Slaby <jslaby@suse.cz>
Wed, 8 Aug 2012 20:26:44 +0000 (22:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Aug 2012 23:45:39 +0000 (16:45 -0700)
commit7e73eca6a7b2967423902a4543821bb97cbbe698
tree8c733036a77be59040ed7e346676445a83043b10
parent0019b4089ccef8148d8be83cc8adfc81a75b47d4
TTY: move cdev_add to tty_register_device

We need the /dev/ node not to be available before we call
tty_register_device. Otherwise we might race with open and
tty_struct->port might not be available at that time.

This is not an issue now, but would be a problem after "TTY: use
tty_port_register_device" is applied.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c
include/linux/tty_driver.h