]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
isdn/gigaset: beautify interface.c
authorTilman Schmidt <tilman@imap.cc>
Mon, 21 Jan 2013 11:57:20 +0000 (11:57 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jan 2013 22:36:25 +0000 (17:36 -0500)
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>
drivers/isdn/gigaset/interface.c

index 67abf3ff45e812eec6ce416a917cacec5a650b39..20b7e7a1190f317bbf31d072c809ab70e919514b 100644 (file)
@@ -112,36 +112,6 @@ static int if_config(struct cardstate *cs, int *arg)
 }
 
 /*** the terminal driver ***/
-/* stolen from usbserial and some other tty drivers */
-
-static int  if_open(struct tty_struct *tty, struct file *filp);
-static void if_close(struct tty_struct *tty, struct file *filp);
-static int  if_ioctl(struct tty_struct *tty,
-                    unsigned int cmd, unsigned long arg);
-static int  if_write_room(struct tty_struct *tty);
-static int  if_chars_in_buffer(struct tty_struct *tty);
-static void if_throttle(struct tty_struct *tty);
-static void if_unthrottle(struct tty_struct *tty);
-static void if_set_termios(struct tty_struct *tty, struct ktermios *old);
-static int  if_tiocmget(struct tty_struct *tty);
-static int  if_tiocmset(struct tty_struct *tty,
-                       unsigned int set, unsigned int clear);
-static int  if_write(struct tty_struct *tty,
-                    const unsigned char *buf, int count);
-
-static const struct tty_operations if_ops = {
-       .open =                 if_open,
-       .close =                if_close,
-       .ioctl =                if_ioctl,
-       .write =                if_write,
-       .write_room =           if_write_room,
-       .chars_in_buffer =      if_chars_in_buffer,
-       .set_termios =          if_set_termios,
-       .throttle =             if_throttle,
-       .unthrottle =           if_unthrottle,
-       .tiocmget =             if_tiocmget,
-       .tiocmset =             if_tiocmset,
-};
 
 static int if_open(struct tty_struct *tty, struct file *filp)
 {
@@ -355,7 +325,7 @@ done:
 static int if_write_room(struct tty_struct *tty)
 {
        struct cardstate *cs = tty->driver_data;
-       int retval = -ENODEV;
+       int retval;
 
        gig_dbg(DEBUG_IF, "%u: %s()", cs->minor_index, __func__);
 
@@ -498,6 +468,20 @@ out:
        mutex_unlock(&cs->mutex);
 }
 
+static const struct tty_operations if_ops = {
+       .open =                 if_open,
+       .close =                if_close,
+       .ioctl =                if_ioctl,
+       .write =                if_write,
+       .write_room =           if_write_room,
+       .chars_in_buffer =      if_chars_in_buffer,
+       .set_termios =          if_set_termios,
+       .throttle =             if_throttle,
+       .unthrottle =           if_unthrottle,
+       .tiocmget =             if_tiocmget,
+       .tiocmset =             if_tiocmset,
+};
+
 
 /* wakeup tasklet for the write operation */
 static void if_wake(unsigned long data)