diff options
| author | Greg Ungerer <gerg@uclinux.org> | 2011-02-08 06:32:36 -0500 |
|---|---|---|
| committer | Greg Ungerer <gerg@uclinux.org> | 2011-02-15 18:43:18 -0500 |
| commit | bc0c36d3c831b5f33ca0dab39535f5deb8c55b62 (patch) | |
| tree | 5afac5eefe19690677c9a3a0779a3536c995e3a9 | |
| parent | 81174262e2e653e15c7ef23efa5f88fe31e91e2a (diff) | |
m68knommu: fix dereference of port.tty
The struct_tty associated with a port is now a direct pointer
from within the local private driver info struct. So fix all uses
of it.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
| -rw-r--r-- | drivers/tty/serial/68328serial.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c index be0ebce36e5..de0160e3f8c 100644 --- a/drivers/tty/serial/68328serial.c +++ b/drivers/tty/serial/68328serial.c | |||
| @@ -262,7 +262,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status) | |||
| 262 | 262 | ||
| 263 | static void receive_chars(struct m68k_serial *info, unsigned short rx) | 263 | static void receive_chars(struct m68k_serial *info, unsigned short rx) |
| 264 | { | 264 | { |
| 265 | struct tty_struct *tty = info->port.tty; | 265 | struct tty_struct *tty = info->tty; |
| 266 | m68328_uart *uart = &uart_addr[info->line]; | 266 | m68328_uart *uart = &uart_addr[info->line]; |
| 267 | unsigned char ch, flag; | 267 | unsigned char ch, flag; |
| 268 | 268 | ||
| @@ -329,7 +329,7 @@ static void transmit_chars(struct m68k_serial *info) | |||
| 329 | goto clear_and_return; | 329 | goto clear_and_return; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | if((info->xmit_cnt <= 0) || info->port.tty->stopped) { | 332 | if((info->xmit_cnt <= 0) || info->tty->stopped) { |
| 333 | /* That's peculiar... TX ints off */ | 333 | /* That's peculiar... TX ints off */ |
| 334 | uart->ustcnt &= ~USTCNT_TX_INTR_MASK; | 334 | uart->ustcnt &= ~USTCNT_TX_INTR_MASK; |
| 335 | goto clear_and_return; | 335 | goto clear_and_return; |
| @@ -383,7 +383,7 @@ static void do_softint(struct work_struct *work) | |||
| 383 | struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); | 383 | struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); |
| 384 | struct tty_struct *tty; | 384 | struct tty_struct *tty; |
| 385 | 385 | ||
| 386 | tty = info->port.tty; | 386 | tty = info->tty; |
| 387 | if (!tty) | 387 | if (!tty) |
| 388 | return; | 388 | return; |
| 389 | #if 0 | 389 | #if 0 |
| @@ -407,7 +407,7 @@ static void do_serial_hangup(struct work_struct *work) | |||
| 407 | struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); | 407 | struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); |
| 408 | struct tty_struct *tty; | 408 | struct tty_struct *tty; |
| 409 | 409 | ||
| 410 | tty = info->port.tty; | 410 | tty = info->tty; |
| 411 | if (!tty) | 411 | if (!tty) |
| 412 | return; | 412 | return; |
| 413 | 413 | ||
| @@ -451,8 +451,8 @@ static int startup(struct m68k_serial * info) | |||
| 451 | uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK; | 451 | uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK; |
| 452 | #endif | 452 | #endif |
| 453 | 453 | ||
| 454 | if (info->port.tty) | 454 | if (info->tty) |
| 455 | clear_bit(TTY_IO_ERROR, &info->port.tty->flags); | 455 | clear_bit(TTY_IO_ERROR, &info->tty->flags); |
| 456 | info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; | 456 | info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; |
| 457 | 457 | ||
| 458 | /* | 458 | /* |
| @@ -486,8 +486,8 @@ static void shutdown(struct m68k_serial * info) | |||
| 486 | info->xmit_buf = 0; | 486 | info->xmit_buf = 0; |
| 487 | } | 487 | } |
| 488 | 488 | ||
| 489 | if (info->port.tty) | 489 | if (info->tty) |
| 490 | set_bit(TTY_IO_ERROR, &info->port.tty->flags); | 490 | set_bit(TTY_IO_ERROR, &info->tty->flags); |
| 491 | 491 | ||
| 492 | info->flags &= ~S_INITIALIZED; | 492 | info->flags &= ~S_INITIALIZED; |
| 493 | local_irq_restore(flags); | 493 | local_irq_restore(flags); |
| @@ -553,9 +553,9 @@ static void change_speed(struct m68k_serial *info) | |||
| 553 | unsigned cflag; | 553 | unsigned cflag; |
| 554 | int i; | 554 | int i; |
| 555 | 555 | ||
| 556 | if (!info->port.tty || !info->port.tty->termios) | 556 | if (!info->tty || !info->tty->termios) |
| 557 | return; | 557 | return; |
| 558 | cflag = info->port.tty->termios->c_cflag; | 558 | cflag = info->tty->termios->c_cflag; |
| 559 | if (!(port = info->port)) | 559 | if (!(port = info->port)) |
| 560 | return; | 560 | return; |
| 561 | 561 | ||
| @@ -970,7 +970,6 @@ static void send_break(struct m68k_serial * info, unsigned int duration) | |||
| 970 | static int rs_ioctl(struct tty_struct *tty, struct file * file, | 970 | static int rs_ioctl(struct tty_struct *tty, struct file * file, |
| 971 | unsigned int cmd, unsigned long arg) | 971 | unsigned int cmd, unsigned long arg) |
| 972 | { | 972 | { |
| 973 | int error; | ||
| 974 | struct m68k_serial * info = (struct m68k_serial *)tty->driver_data; | 973 | struct m68k_serial * info = (struct m68k_serial *)tty->driver_data; |
| 975 | int retval; | 974 | int retval; |
| 976 | 975 | ||
| @@ -1104,7 +1103,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) | |||
| 1104 | tty_ldisc_flush(tty); | 1103 | tty_ldisc_flush(tty); |
| 1105 | tty->closing = 0; | 1104 | tty->closing = 0; |
| 1106 | info->event = 0; | 1105 | info->event = 0; |
| 1107 | info->port.tty = NULL; | 1106 | info->tty = NULL; |
| 1108 | #warning "This is not and has never been valid so fix it" | 1107 | #warning "This is not and has never been valid so fix it" |
| 1109 | #if 0 | 1108 | #if 0 |
| 1110 | if (tty->ldisc.num != ldiscs[N_TTY].num) { | 1109 | if (tty->ldisc.num != ldiscs[N_TTY].num) { |
| @@ -1142,7 +1141,7 @@ void rs_hangup(struct tty_struct *tty) | |||
| 1142 | info->event = 0; | 1141 | info->event = 0; |
| 1143 | info->count = 0; | 1142 | info->count = 0; |
| 1144 | info->flags &= ~S_NORMAL_ACTIVE; | 1143 | info->flags &= ~S_NORMAL_ACTIVE; |
| 1145 | info->port.tty = NULL; | 1144 | info->tty = NULL; |
| 1146 | wake_up_interruptible(&info->open_wait); | 1145 | wake_up_interruptible(&info->open_wait); |
| 1147 | } | 1146 | } |
| 1148 | 1147 | ||
| @@ -1261,7 +1260,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) | |||
| 1261 | 1260 | ||
| 1262 | info->count++; | 1261 | info->count++; |
| 1263 | tty->driver_data = info; | 1262 | tty->driver_data = info; |
| 1264 | info->port.tty = tty; | 1263 | info->tty = tty; |
| 1265 | 1264 | ||
| 1266 | /* | 1265 | /* |
| 1267 | * Start up serial port | 1266 | * Start up serial port |
| @@ -1338,7 +1337,7 @@ rs68328_init(void) | |||
| 1338 | info = &m68k_soft[i]; | 1337 | info = &m68k_soft[i]; |
| 1339 | info->magic = SERIAL_MAGIC; | 1338 | info->magic = SERIAL_MAGIC; |
| 1340 | info->port = (int) &uart_addr[i]; | 1339 | info->port = (int) &uart_addr[i]; |
| 1341 | info->port.tty = NULL; | 1340 | info->tty = NULL; |
| 1342 | info->irq = uart_irqs[i]; | 1341 | info->irq = uart_irqs[i]; |
| 1343 | info->custom_divisor = 16; | 1342 | info->custom_divisor = 16; |
| 1344 | info->close_delay = 50; | 1343 | info->close_delay = 50; |
