This forgot to update a field in the old char drivers. The fact nobody
has basically noticed (except one mxser user) rather suggests most of these
drivers could go into the bitbucket.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Dan Carpenter <error27@gmail.com>
Cc: Andreas Pretzsch <apr@cn-eng.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
if (tport == NULL)
return -ENODEV;
port = container_of(tport, struct isi_port, port);
if (tport == NULL)
return -ENODEV;
port = container_of(tport, struct isi_port, port);
- card = &isi_card[BOARD(tty->index)];
+ tty->driver_data = port;
return tty_port_open(tport, tty, filp);
}
return tty_port_open(tport, tty, filp);
}
static void isicom_close(struct tty_struct *tty, struct file *filp)
{
struct isi_port *ip = tty->driver_data;
static void isicom_close(struct tty_struct *tty, struct file *filp)
{
struct isi_port *ip = tty->driver_data;
- struct tty_port *port = &ip->port;
+ struct tty_port *port;
+
+ if (ip == NULL)
+ return;
+
+ port = &ip->port;
if (isicom_paranoia_check(ip, tty->name, "isicom_close"))
return;
tty_port_close(port, tty, filp);
if (isicom_paranoia_check(ip, tty->name, "isicom_close"))
return;
tty_port_close(port, tty, filp);
return -ENODEV;
if (portp->devnr < 1)
return -ENODEV;
return -ENODEV;
if (portp->devnr < 1)
return -ENODEV;
+
+ tty->driver_data = portp;
return tty_port_open(&portp->port, tty, filp);
}
return tty_port_open(&portp->port, tty, filp);
}
if (!info->ioaddr)
return -ENODEV;
if (!info->ioaddr)
return -ENODEV;
+ tty->driver_data = info;
return tty_port_open(&info->port, tty, filp);
}
return tty_port_open(&info->port, tty, filp);
}
struct mxser_port *info = tty->driver_data;
struct tty_port *port = &info->port;
struct mxser_port *info = tty->driver_data;
struct tty_port *port = &info->port;
- if (tty->index == MXSER_PORTS)
+ if (tty->index == MXSER_PORTS || info == NULL)
return;
if (tty_port_close_start(port, tty, filp) == 0)
return;
return;
if (tty_port_close_start(port, tty, filp) == 0)
return;
+ tty->driver_data = port;
return tty_port_open(&port->port, tty, filp);
}
return tty_port_open(&port->port, tty, filp);
}
{
struct stlport *portp;
struct stlbrd *brdp;
{
struct stlport *portp;
struct stlbrd *brdp;
unsigned int minordev, brdnr, panelnr;
int portnr;
unsigned int minordev, brdnr, panelnr;
int portnr;
portp = brdp->panels[panelnr]->ports[portnr];
if (portp == NULL)
return -ENODEV;
portp = brdp->panels[panelnr]->ports[portnr];
if (portp == NULL)
return -ENODEV;
+
+ tty->driver_data = portp;
return tty_port_open(&portp->port, tty, filp);
}
return tty_port_open(&portp->port, tty, filp);
}
pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp);
portp = tty->driver_data;
pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp);
portp = tty->driver_data;
+ if(portp == NULL)
+ return;
tty_port_close(&portp->port, tty, filp);
}
tty_port_close(&portp->port, tty, filp);
}