diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-23 16:45:32 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-23 16:45:32 -0700 |
| commit | 476453b10b1fc691ce43d2411af93c526effa278 (patch) | |
| tree | 37eab2ef56bff44c272915c7b72e56c4679ac6da /tty.current | |
| parent | e059f9c1f697e4f2b69d0144b8dea8c938a97f14 (diff) | |
| download | patches-476453b10b1fc691ce43d2411af93c526effa278.tar.gz | |
tty bugfix
Diffstat (limited to 'tty.current')
| -rw-r--r-- | tty.current/tty-fix-regressions-in-the-char-driver-conversion.patch | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/tty.current/tty-fix-regressions-in-the-char-driver-conversion.patch b/tty.current/tty-fix-regressions-in-the-char-driver-conversion.patch new file mode 100644 index 00000000000000..13b27b5125dc59 --- /dev/null +++ b/tty.current/tty-fix-regressions-in-the-char-driver-conversion.patch @@ -0,0 +1,122 @@ +From alan@linux.intel.com Fri Apr 23 16:42:51 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Fri, 23 Apr 2010 16:01:18 +0100 +Subject: tty: Fix regressions in the char driver conversion +To: Jiri Slaby <jirislaby@gmail.com> +Cc: Dan Carpenter <error27@gmail.com>, Andreas Pretzsch <apr@cn-eng.de>, Greg KH <gregkh@suse.de> +Message-ID: <20100423160118.388dfe5e@linux.intel.com> + +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> + +--- + drivers/char/isicom.c | 9 +++++++-- + drivers/char/istallion.c | 2 ++ + drivers/char/mxser.c | 3 ++- + drivers/char/riscom8.c | 1 + + drivers/char/stallion.c | 7 ++++--- + 5 files changed, 16 insertions(+), 6 deletions(-) + +--- a/drivers/char/isicom.c ++++ b/drivers/char/isicom.c +@@ -879,8 +879,8 @@ static int isicom_open(struct tty_struct + 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); + } + +@@ -936,7 +936,12 @@ static void isicom_shutdown(struct tty_p + 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); +--- a/drivers/char/istallion.c ++++ b/drivers/char/istallion.c +@@ -827,6 +827,8 @@ static int stli_open(struct tty_struct * + return -ENODEV; + if (portp->devnr < 1) + return -ENODEV; ++ ++ tty->driver_data = portp; + return tty_port_open(&portp->port, tty, filp); + } + +--- a/drivers/char/mxser.c ++++ b/drivers/char/mxser.c +@@ -1011,6 +1011,7 @@ static int mxser_open(struct tty_struct + if (!info->ioaddr) + return -ENODEV; + ++ tty->driver_data = info; + return tty_port_open(&info->port, tty, filp); + } + +@@ -1074,7 +1075,7 @@ static void mxser_close(struct tty_struc + 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; +--- a/drivers/char/riscom8.c ++++ b/drivers/char/riscom8.c +@@ -909,6 +909,7 @@ static int rc_open(struct tty_struct *tt + if (error) + return error; + ++ tty->driver_data = port; + return tty_port_open(&port->port, tty, filp); + } + +--- a/drivers/char/stallion.c ++++ b/drivers/char/stallion.c +@@ -724,7 +724,6 @@ static int stl_open(struct tty_struct *t + { + struct stlport *portp; + struct stlbrd *brdp; +- struct tty_port *port; + unsigned int minordev, brdnr, panelnr; + int portnr; + +@@ -754,7 +753,8 @@ static int stl_open(struct tty_struct *t + portp = brdp->panels[panelnr]->ports[portnr]; + if (portp == NULL) + return -ENODEV; +- port = &portp->port; ++ ++ tty->driver_data = portp; + return tty_port_open(&portp->port, tty, filp); + + } +@@ -841,7 +841,8 @@ static void stl_close(struct tty_struct + pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp); + + portp = tty->driver_data; +- BUG_ON(portp == NULL); ++ if(portp == NULL) ++ return; + tty_port_close(&portp->port, tty, filp); + } + |
