aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/serial167.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/serial167.c')
-rw-r--r--drivers/char/serial167.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index b4ea1266b663..48dae5d68dac 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -119,17 +119,6 @@ struct cyclades_port cy_port[] = {
119#define NR_PORTS ARRAY_SIZE(cy_port) 119#define NR_PORTS ARRAY_SIZE(cy_port)
120 120
121/* 121/*
122 * tmp_buf is used as a temporary buffer by serial_write. We need to
123 * lock it in case the copy_from_user blocks while swapping in a page,
124 * and some other program tries to do a serial write at the same time.
125 * Since the lock will only come under contention when the system is
126 * swapping and available memory is low, it makes sense to share one
127 * buffer across all the serial ports, since it significantly saves
128 * memory if large numbers of serial ports are open.
129 */
130static unsigned char *tmp_buf = 0;
131
132/*
133 * This is used to look up the divisor speeds and the timeouts 122 * This is used to look up the divisor speeds and the timeouts
134 * We're normally limited to 15 distinct baud rates. The extra 123 * We're normally limited to 15 distinct baud rates. The extra
135 * are accessed via settings in info->flags. 124 * are accessed via settings in info->flags.
@@ -1198,7 +1187,7 @@ cy_write(struct tty_struct * tty,
1198 return 0; 1187 return 0;
1199 } 1188 }
1200 1189
1201 if (!tty || !info->xmit_buf || !tmp_buf){ 1190 if (!tty || !info->xmit_buf){
1202 return 0; 1191 return 0;
1203 } 1192 }
1204 1193
@@ -1983,13 +1972,6 @@ cy_open(struct tty_struct *tty, struct file * filp)
1983 tty->driver_data = info; 1972 tty->driver_data = info;
1984 info->tty = tty; 1973 info->tty = tty;
1985 1974
1986 if (!tmp_buf) {
1987 tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL);
1988 if (!tmp_buf){
1989 return -ENOMEM;
1990 }
1991 }
1992
1993 /* 1975 /*
1994 * Start up serial port 1976 * Start up serial port
1995 */ 1977 */