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>
This commit is contained in:
Родитель
81174262e2
Коммит
bc0c36d3c8
|
@ -262,7 +262,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status)
|
||||||
|
|
||||||
static void receive_chars(struct m68k_serial *info, unsigned short rx)
|
static void receive_chars(struct m68k_serial *info, unsigned short rx)
|
||||||
{
|
{
|
||||||
struct tty_struct *tty = info->port.tty;
|
struct tty_struct *tty = info->tty;
|
||||||
m68328_uart *uart = &uart_addr[info->line];
|
m68328_uart *uart = &uart_addr[info->line];
|
||||||
unsigned char ch, flag;
|
unsigned char ch, flag;
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ static void transmit_chars(struct m68k_serial *info)
|
||||||
goto clear_and_return;
|
goto clear_and_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((info->xmit_cnt <= 0) || info->port.tty->stopped) {
|
if((info->xmit_cnt <= 0) || info->tty->stopped) {
|
||||||
/* That's peculiar... TX ints off */
|
/* That's peculiar... TX ints off */
|
||||||
uart->ustcnt &= ~USTCNT_TX_INTR_MASK;
|
uart->ustcnt &= ~USTCNT_TX_INTR_MASK;
|
||||||
goto clear_and_return;
|
goto clear_and_return;
|
||||||
|
@ -383,7 +383,7 @@ static void do_softint(struct work_struct *work)
|
||||||
struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue);
|
struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue);
|
||||||
struct tty_struct *tty;
|
struct tty_struct *tty;
|
||||||
|
|
||||||
tty = info->port.tty;
|
tty = info->tty;
|
||||||
if (!tty)
|
if (!tty)
|
||||||
return;
|
return;
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -407,7 +407,7 @@ static void do_serial_hangup(struct work_struct *work)
|
||||||
struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup);
|
struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup);
|
||||||
struct tty_struct *tty;
|
struct tty_struct *tty;
|
||||||
|
|
||||||
tty = info->port.tty;
|
tty = info->tty;
|
||||||
if (!tty)
|
if (!tty)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -451,8 +451,8 @@ static int startup(struct m68k_serial * info)
|
||||||
uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK;
|
uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (info->port.tty)
|
if (info->tty)
|
||||||
clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
|
clear_bit(TTY_IO_ERROR, &info->tty->flags);
|
||||||
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
|
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -486,8 +486,8 @@ static void shutdown(struct m68k_serial * info)
|
||||||
info->xmit_buf = 0;
|
info->xmit_buf = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->port.tty)
|
if (info->tty)
|
||||||
set_bit(TTY_IO_ERROR, &info->port.tty->flags);
|
set_bit(TTY_IO_ERROR, &info->tty->flags);
|
||||||
|
|
||||||
info->flags &= ~S_INITIALIZED;
|
info->flags &= ~S_INITIALIZED;
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
|
@ -553,9 +553,9 @@ static void change_speed(struct m68k_serial *info)
|
||||||
unsigned cflag;
|
unsigned cflag;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!info->port.tty || !info->port.tty->termios)
|
if (!info->tty || !info->tty->termios)
|
||||||
return;
|
return;
|
||||||
cflag = info->port.tty->termios->c_cflag;
|
cflag = info->tty->termios->c_cflag;
|
||||||
if (!(port = info->port))
|
if (!(port = info->port))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -970,7 +970,6 @@ static void send_break(struct m68k_serial * info, unsigned int duration)
|
||||||
static int rs_ioctl(struct tty_struct *tty, struct file * file,
|
static int rs_ioctl(struct tty_struct *tty, struct file * file,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
int error;
|
|
||||||
struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
|
struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
|
@ -1104,7 +1103,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
|
||||||
tty_ldisc_flush(tty);
|
tty_ldisc_flush(tty);
|
||||||
tty->closing = 0;
|
tty->closing = 0;
|
||||||
info->event = 0;
|
info->event = 0;
|
||||||
info->port.tty = NULL;
|
info->tty = NULL;
|
||||||
#warning "This is not and has never been valid so fix it"
|
#warning "This is not and has never been valid so fix it"
|
||||||
#if 0
|
#if 0
|
||||||
if (tty->ldisc.num != ldiscs[N_TTY].num) {
|
if (tty->ldisc.num != ldiscs[N_TTY].num) {
|
||||||
|
@ -1142,7 +1141,7 @@ void rs_hangup(struct tty_struct *tty)
|
||||||
info->event = 0;
|
info->event = 0;
|
||||||
info->count = 0;
|
info->count = 0;
|
||||||
info->flags &= ~S_NORMAL_ACTIVE;
|
info->flags &= ~S_NORMAL_ACTIVE;
|
||||||
info->port.tty = NULL;
|
info->tty = NULL;
|
||||||
wake_up_interruptible(&info->open_wait);
|
wake_up_interruptible(&info->open_wait);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1261,7 +1260,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
|
||||||
|
|
||||||
info->count++;
|
info->count++;
|
||||||
tty->driver_data = info;
|
tty->driver_data = info;
|
||||||
info->port.tty = tty;
|
info->tty = tty;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start up serial port
|
* Start up serial port
|
||||||
|
@ -1338,7 +1337,7 @@ rs68328_init(void)
|
||||||
info = &m68k_soft[i];
|
info = &m68k_soft[i];
|
||||||
info->magic = SERIAL_MAGIC;
|
info->magic = SERIAL_MAGIC;
|
||||||
info->port = (int) &uart_addr[i];
|
info->port = (int) &uart_addr[i];
|
||||||
info->port.tty = NULL;
|
info->tty = NULL;
|
||||||
info->irq = uart_irqs[i];
|
info->irq = uart_irqs[i];
|
||||||
info->custom_divisor = 16;
|
info->custom_divisor = 16;
|
||||||
info->close_delay = 50;
|
info->close_delay = 50;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче