diff options
Diffstat (limited to 'drivers/char/serial167.c')
-rw-r--r-- | drivers/char/serial167.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index b4ea1266b663..f4809c8183cc 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 | */ | ||
130 | static 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. |
@@ -1132,7 +1121,7 @@ cy_put_char(struct tty_struct *tty, unsigned char ch) | |||
1132 | if (serial_paranoia_check(info, tty->name, "cy_put_char")) | 1121 | if (serial_paranoia_check(info, tty->name, "cy_put_char")) |
1133 | return; | 1122 | return; |
1134 | 1123 | ||
1135 | if (!tty || !info->xmit_buf) | 1124 | if (!info->xmit_buf) |
1136 | return; | 1125 | return; |
1137 | 1126 | ||
1138 | local_irq_save(flags); | 1127 | local_irq_save(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 (!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 | */ |