Skip to content

Commit

Permalink
misc: pti, fix tty_port count
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Aug 10, 2012
1 parent fbf1c24 commit 5bd4200
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/misc/pti.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct pti_tty {
};

struct pti_dev {
struct tty_port port;
struct tty_port port[PTITTY_MINOR_NUM];
unsigned long pti_addr;
unsigned long aperture_base;
void __iomem *pti_ioaddr;
Expand Down Expand Up @@ -427,7 +427,7 @@ static int pti_tty_driver_open(struct tty_struct *tty, struct file *filp)
* also removes a locking requirement for the actual write
* procedure.
*/
return tty_port_open(&drv_data->port, tty, filp);
return tty_port_open(&drv_data->port[tty->index], tty, filp);
}

/**
Expand All @@ -443,7 +443,7 @@ static int pti_tty_driver_open(struct tty_struct *tty, struct file *filp)
*/
static void pti_tty_driver_close(struct tty_struct *tty, struct file *filp)
{
tty_port_close(&drv_data->port, tty, filp);
tty_port_close(&drv_data->port[tty->index], tty, filp);
}

/**
Expand Down Expand Up @@ -799,6 +799,7 @@ static const struct tty_port_operations tty_port_ops = {
static int __devinit pti_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
unsigned int a;
int retval = -EINVAL;
int pci_bar = 1;

Expand Down Expand Up @@ -850,11 +851,13 @@ static int __devinit pti_pci_probe(struct pci_dev *pdev,

pci_set_drvdata(pdev, drv_data);

tty_port_init(&drv_data->port);
drv_data->port.ops = &tty_port_ops;
for (a = 0; a < PTITTY_MINOR_NUM; a++) {
struct tty_port *port = &drv_data->port[a];
tty_port_init(port);
port->ops = &tty_port_ops;

tty_register_device(pti_tty_driver, 0, &pdev->dev);
tty_register_device(pti_tty_driver, 1, &pdev->dev);
tty_register_device(pti_tty_driver, a, &pdev->dev);
}

register_console(&pti_console);

Expand Down

0 comments on commit 5bd4200

Please sign in to comment.