diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-06-26 10:47:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 19:24:32 -0400 |
commit | c7b13475b4466adcdcd8378f12b4ee416ef9b98b (patch) | |
tree | 5c02f98f19dd07c7613a74fb14dc4f37994e719f /drivers/usb/serial/console.c | |
parent | 7b94cae47cbfaa1a64cd51b3735eba3abe6af827 (diff) |
USB: console: remove unnecessary operations test
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>
Diffstat (limited to 'drivers/usb/serial/console.c')
-rw-r--r-- | drivers/usb/serial/console.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index bfad2cd39bf3..c69bb50d4663 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
@@ -151,11 +151,7 @@ static int usb_console_setup(struct console *co, char *options) | |||
151 | 151 | ||
152 | /* only call the device specific open if this | 152 | /* only call the device specific open if this |
153 | * is the first time the port is opened */ | 153 | * is the first time the port is opened */ |
154 | if (serial->type->open) | 154 | retval = serial->type->open(NULL, port); |
155 | retval = serial->type->open(NULL, port); | ||
156 | else | ||
157 | retval = usb_serial_generic_open(NULL, port); | ||
158 | |||
159 | if (retval) { | 155 | if (retval) { |
160 | dev_err(&port->dev, "could not open USB console port\n"); | 156 | dev_err(&port->dev, "could not open USB console port\n"); |
161 | goto fail; | 157 | goto fail; |
@@ -230,20 +226,12 @@ static void usb_console_write(struct console *co, | |||
230 | } | 226 | } |
231 | /* pass on to the driver specific version of this function if | 227 | /* pass on to the driver specific version of this function if |
232 | it is available */ | 228 | it is available */ |
233 | if (serial->type->write) | 229 | retval = serial->type->write(NULL, port, buf, i); |
234 | retval = serial->type->write(NULL, port, buf, i); | ||
235 | else | ||
236 | retval = usb_serial_generic_write(NULL, port, buf, i); | ||
237 | dev_dbg(&port->dev, "%s - write: %d\n", __func__, retval); | 230 | dev_dbg(&port->dev, "%s - write: %d\n", __func__, retval); |
238 | if (lf) { | 231 | if (lf) { |
239 | /* append CR after LF */ | 232 | /* append CR after LF */ |
240 | unsigned char cr = 13; | 233 | unsigned char cr = 13; |
241 | if (serial->type->write) | 234 | retval = serial->type->write(NULL, port, &cr, 1); |
242 | retval = serial->type->write(NULL, | ||
243 | port, &cr, 1); | ||
244 | else | ||
245 | retval = usb_serial_generic_write(NULL, | ||
246 | port, &cr, 1); | ||
247 | dev_dbg(&port->dev, "%s - write cr: %d\n", | 235 | dev_dbg(&port->dev, "%s - write cr: %d\n", |
248 | __func__, retval); | 236 | __func__, retval); |
249 | } | 237 | } |