USB: console: remove unnecessary operations test
authorJohan Hovold <jhovold@gmail.com>
Wed, 26 Jun 2013 14:47:26 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 23:24:32 +0000 (16:24 -0700)
Remove unnecessary tests for open and write operations as these are set
to the generic implementations by usb-serial core if left unset by a
subdriver.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/console.c

index bfad2cd39bf3954cccaba331e99c36715f8ba8f0..c69bb50d46635dfb2148f580739f99b46c5602dc 100644 (file)
@@ -151,11 +151,7 @@ static int usb_console_setup(struct console *co, char *options)
 
                /* only call the device specific open if this
                 * is the first time the port is opened */
-               if (serial->type->open)
-                       retval = serial->type->open(NULL, port);
-               else
-                       retval = usb_serial_generic_open(NULL, port);
-
+               retval = serial->type->open(NULL, port);
                if (retval) {
                        dev_err(&port->dev, "could not open USB console port\n");
                        goto fail;
@@ -230,20 +226,12 @@ static void usb_console_write(struct console *co,
                }
                /* pass on to the driver specific version of this function if
                   it is available */
-               if (serial->type->write)
-                       retval = serial->type->write(NULL, port, buf, i);
-               else
-                       retval = usb_serial_generic_write(NULL, port, buf, i);
+               retval = serial->type->write(NULL, port, buf, i);
                dev_dbg(&port->dev, "%s - write: %d\n", __func__, retval);
                if (lf) {
                        /* append CR after LF */
                        unsigned char cr = 13;
-                       if (serial->type->write)
-                               retval = serial->type->write(NULL,
-                                                               port, &cr, 1);
-                       else
-                               retval = usb_serial_generic_write(NULL,
-                                                               port, &cr, 1);
+                       retval = serial->type->write(NULL, port, &cr, 1);
                        dev_dbg(&port->dev, "%s - write cr: %d\n",
                                                        __func__, retval);
                }