aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-08-07 15:47:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-10 16:29:57 -0400
commit5bd420009716f3348610fdf9c6307f0db583ba04 (patch)
tree59041467e7ab06f8e005b4004a7e29e9ab3b239d /drivers/misc
parentfbf1c247dac8574ef3973adce4b20d40ff22214e (diff)
misc: pti, fix tty_port count
We now have *one* tty_port for both TTYs. How this was supposed to work? Change it to have a tty_port for each of TTYs. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: J Freyensee <james_p_freyensee@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/pti.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/misc/pti.c b/drivers/misc/pti.c
index 90de855abb90..fe76f9dca1de 100644
--- a/drivers/misc/pti.c
+++ b/drivers/misc/pti.c
@@ -60,7 +60,7 @@ struct pti_tty {
60}; 60};
61 61
62struct pti_dev { 62struct pti_dev {
63 struct tty_port port; 63 struct tty_port port[PTITTY_MINOR_NUM];
64 unsigned long pti_addr; 64 unsigned long pti_addr;
65 unsigned long aperture_base; 65 unsigned long aperture_base;
66 void __iomem *pti_ioaddr; 66 void __iomem *pti_ioaddr;
@@ -427,7 +427,7 @@ static int pti_tty_driver_open(struct tty_struct *tty, struct file *filp)
427 * also removes a locking requirement for the actual write 427 * also removes a locking requirement for the actual write
428 * procedure. 428 * procedure.
429 */ 429 */
430 return tty_port_open(&drv_data->port, tty, filp); 430 return tty_port_open(&drv_data->port[tty->index], tty, filp);
431} 431}
432 432
433/** 433/**
@@ -443,7 +443,7 @@ static int pti_tty_driver_open(struct tty_struct *tty, struct file *filp)
443 */ 443 */
444static void pti_tty_driver_close(struct tty_struct *tty, struct file *filp) 444static void pti_tty_driver_close(struct tty_struct *tty, struct file *filp)
445{ 445{
446 tty_port_close(&drv_data->port, tty, filp); 446 tty_port_close(&drv_data->port[tty->index], tty, filp);
447} 447}
448 448
449/** 449/**
@@ -799,6 +799,7 @@ static const struct tty_port_operations tty_port_ops = {
799static int __devinit pti_pci_probe(struct pci_dev *pdev, 799static int __devinit pti_pci_probe(struct pci_dev *pdev,
800 const struct pci_device_id *ent) 800 const struct pci_device_id *ent)
801{ 801{
802 unsigned int a;
802 int retval = -EINVAL; 803 int retval = -EINVAL;
803 int pci_bar = 1; 804 int pci_bar = 1;
804 805
@@ -850,11 +851,13 @@ static int __devinit pti_pci_probe(struct pci_dev *pdev,
850 851
851 pci_set_drvdata(pdev, drv_data); 852 pci_set_drvdata(pdev, drv_data);
852 853
853 tty_port_init(&drv_data->port); 854 for (a = 0; a < PTITTY_MINOR_NUM; a++) {
854 drv_data->port.ops = &tty_port_ops; 855 struct tty_port *port = &drv_data->port[a];
856 tty_port_init(port);
857 port->ops = &tty_port_ops;
855 858
856 tty_register_device(pti_tty_driver, 0, &pdev->dev); 859 tty_register_device(pti_tty_driver, a, &pdev->dev);
857 tty_register_device(pti_tty_driver, 1, &pdev->dev); 860 }
858 861
859 register_console(&pti_console); 862 register_console(&pti_console);
860 863