TTY: use tty_port_register_device
Currently we have no way to assign tty->port while performing tty installation. There are two ways to provide the link tty_struct => tty_port. Either by calling tty_port_install from tty->ops->install or tty_port_register_device called instead of tty_register_device when the device is being set up after connected. In this patch we modify most of the drivers to do the latter. When the drivers use tty_register_device and we have tty_port already, we switch to tty_port_register_device. So we have the tty_struct => tty_port link for free for those. 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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
7e73eca6a7
commit
734cc17838
@@ -524,7 +524,8 @@ void gigaset_if_init(struct cardstate *cs)
|
||||
tasklet_init(&cs->if_wake_tasklet, if_wake, (unsigned long) cs);
|
||||
|
||||
mutex_lock(&cs->mutex);
|
||||
cs->tty_dev = tty_register_device(drv->tty, cs->minor_index, NULL);
|
||||
cs->tty_dev = tty_port_register_device(&cs->port, drv->tty,
|
||||
cs->minor_index, NULL);
|
||||
|
||||
if (!IS_ERR(cs->tty_dev))
|
||||
dev_set_drvdata(cs->tty_dev, cs);
|
||||
|
Reference in New Issue
Block a user