Commit b0882dfe authored by Stephen Hemminger's avatar Stephen Hemminger

[PATCH] Fix modularization of Siemens line discipline

Convert SIEMENS R3964 tty line discipline on 2.6.0-test5 to use tty_ldisc owner
instead of explicit MOD_INC/DEC.

And fix the initializer to be a much more readable C99 one.
parent 96822634
...@@ -150,22 +150,18 @@ static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp, ...@@ -150,22 +150,18 @@ static void r3964_receive_buf(struct tty_struct *tty, const unsigned char *cp,
static int r3964_receive_room(struct tty_struct *tty); static int r3964_receive_room(struct tty_struct *tty);
static struct tty_ldisc tty_ldisc_N_R3964 = { static struct tty_ldisc tty_ldisc_N_R3964 = {
TTY_LDISC_MAGIC, /* magic */ .owner = THIS_MODULE,
"R3964", /* name */ .magic = TTY_LDISC_MAGIC,
0, /* num */ .name = "R3964",
0, /* flags */ .open = r3964_open,
r3964_open, /* open */ .close = r3964_close,
r3964_close, /* close */ .read = r3964_read,
0, /* flush_buffer */ .write = r3964_write,
0, /* chars_in_buffer */ .ioctl = r3964_ioctl,
r3964_read, /* read */ .set_termios = r3964_set_termios,
r3964_write, /* write */ .poll = r3964_poll,
r3964_ioctl, /* ioctl */ .receive_buf = r3964_receive_buf,
r3964_set_termios, /* set_termios */ .receive_room = r3964_receive_room,
r3964_poll, /* poll */
r3964_receive_buf, /* receive_buf */
r3964_receive_room, /* receive_room */
0 /* write_wakeup */
}; };
...@@ -1070,8 +1066,6 @@ static int r3964_open(struct tty_struct *tty) ...@@ -1070,8 +1066,6 @@ static int r3964_open(struct tty_struct *tty)
{ {
struct r3964_info *pInfo; struct r3964_info *pInfo;
MOD_INC_USE_COUNT;
TRACE_L("open"); TRACE_L("open");
TRACE_L("tty=%x, PID=%d, disc_data=%x", TRACE_L("tty=%x, PID=%d, disc_data=%x",
(int)tty, current->pid, (int)tty->disc_data); (int)tty, current->pid, (int)tty->disc_data);
...@@ -1188,8 +1182,6 @@ static void r3964_close(struct tty_struct *tty) ...@@ -1188,8 +1182,6 @@ static void r3964_close(struct tty_struct *tty)
TRACE_M("r3964_close - tx_buf kfree %x",(int)pInfo->tx_buf); TRACE_M("r3964_close - tx_buf kfree %x",(int)pInfo->tx_buf);
kfree(pInfo); kfree(pInfo);
TRACE_M("r3964_close - info kfree %x",(int)pInfo); TRACE_M("r3964_close - info kfree %x",(int)pInfo);
MOD_DEC_USE_COUNT;
} }
static ssize_t r3964_read(struct tty_struct *tty, struct file *file, static ssize_t r3964_read(struct tty_struct *tty, struct file *file,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment