diff options
author | Tilman Schmidt <tilman@imap.cc> | 2013-01-21 06:57:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-21 17:36:25 -0500 |
commit | cdc4827098d128423297720dcf33792d85079b78 (patch) | |
tree | 8c3b755080f25a11079409bea9e27ac309483551 /drivers/isdn/gigaset | |
parent | d2ca8481941efca3300227f0a60003af21ad2895 (diff) |
isdn/gigaset: beautify interface.c
Avoid forward declarations and remove a needless initialization.
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index 67abf3ff45e8..20b7e7a1190f 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c | |||
@@ -112,36 +112,6 @@ static int if_config(struct cardstate *cs, int *arg) | |||
112 | } | 112 | } |
113 | 113 | ||
114 | /*** the terminal driver ***/ | 114 | /*** the terminal driver ***/ |
115 | /* stolen from usbserial and some other tty drivers */ | ||
116 | |||
117 | static int if_open(struct tty_struct *tty, struct file *filp); | ||
118 | static void if_close(struct tty_struct *tty, struct file *filp); | ||
119 | static int if_ioctl(struct tty_struct *tty, | ||
120 | unsigned int cmd, unsigned long arg); | ||
121 | static int if_write_room(struct tty_struct *tty); | ||
122 | static int if_chars_in_buffer(struct tty_struct *tty); | ||
123 | static void if_throttle(struct tty_struct *tty); | ||
124 | static void if_unthrottle(struct tty_struct *tty); | ||
125 | static void if_set_termios(struct tty_struct *tty, struct ktermios *old); | ||
126 | static int if_tiocmget(struct tty_struct *tty); | ||
127 | static int if_tiocmset(struct tty_struct *tty, | ||
128 | unsigned int set, unsigned int clear); | ||
129 | static int if_write(struct tty_struct *tty, | ||
130 | const unsigned char *buf, int count); | ||
131 | |||
132 | static const struct tty_operations if_ops = { | ||
133 | .open = if_open, | ||
134 | .close = if_close, | ||
135 | .ioctl = if_ioctl, | ||
136 | .write = if_write, | ||
137 | .write_room = if_write_room, | ||
138 | .chars_in_buffer = if_chars_in_buffer, | ||
139 | .set_termios = if_set_termios, | ||
140 | .throttle = if_throttle, | ||
141 | .unthrottle = if_unthrottle, | ||
142 | .tiocmget = if_tiocmget, | ||
143 | .tiocmset = if_tiocmset, | ||
144 | }; | ||
145 | 115 | ||
146 | static int if_open(struct tty_struct *tty, struct file *filp) | 116 | static int if_open(struct tty_struct *tty, struct file *filp) |
147 | { | 117 | { |
@@ -355,7 +325,7 @@ done: | |||
355 | static int if_write_room(struct tty_struct *tty) | 325 | static int if_write_room(struct tty_struct *tty) |
356 | { | 326 | { |
357 | struct cardstate *cs = tty->driver_data; | 327 | struct cardstate *cs = tty->driver_data; |
358 | int retval = -ENODEV; | 328 | int retval; |
359 | 329 | ||
360 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); | 330 | gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__); |
361 | 331 | ||
@@ -498,6 +468,20 @@ out: | |||
498 | mutex_unlock(&cs->mutex); | 468 | mutex_unlock(&cs->mutex); |
499 | } | 469 | } |
500 | 470 | ||
471 | static const struct tty_operations if_ops = { | ||
472 | .open = if_open, | ||
473 | .close = if_close, | ||
474 | .ioctl = if_ioctl, | ||
475 | .write = if_write, | ||
476 | .write_room = if_write_room, | ||
477 | .chars_in_buffer = if_chars_in_buffer, | ||
478 | .set_termios = if_set_termios, | ||
479 | .throttle = if_throttle, | ||
480 | .unthrottle = if_unthrottle, | ||
481 | .tiocmget = if_tiocmget, | ||
482 | .tiocmset = if_tiocmset, | ||
483 | }; | ||
484 | |||
501 | 485 | ||
502 | /* wakeup tasklet for the write operation */ | 486 | /* wakeup tasklet for the write operation */ |
503 | static void if_wake(unsigned long data) | 487 | static void if_wake(unsigned long data) |