diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-08-07 15:47:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-13 19:50:19 -0400 |
commit | 734cc1783816ae358cef45673a29bf7af974e147 (patch) | |
tree | 146fde2a1add56ff7a35915d0fd1db7e01ce6630 /drivers/tty/synclink_gt.c | |
parent | 7e73eca6a7b2967423902a4543821bb97cbbe698 (diff) |
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>
Diffstat (limited to 'drivers/tty/synclink_gt.c')
-rw-r--r-- | drivers/tty/synclink_gt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 913025369fe7..45f6136f4e51 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c | |||
@@ -3689,8 +3689,11 @@ static void device_init(int adapter_num, struct pci_dev *pdev) | |||
3689 | } | 3689 | } |
3690 | } | 3690 | } |
3691 | 3691 | ||
3692 | for (i=0; i < port_count; ++i) | 3692 | for (i = 0; i < port_count; ++i) { |
3693 | tty_register_device(serial_driver, port_array[i]->line, &(port_array[i]->pdev->dev)); | 3693 | struct slgt_info *info = port_array[i]; |
3694 | tty_port_register_device(&info->port, serial_driver, info->line, | ||
3695 | &info->pdev->dev); | ||
3696 | } | ||
3694 | } | 3697 | } |
3695 | 3698 | ||
3696 | static int __devinit init_one(struct pci_dev *dev, | 3699 | static int __devinit init_one(struct pci_dev *dev, |