diff options
Diffstat (limited to 'drivers/usb/serial/opticon.c')
-rw-r--r-- | drivers/usb/serial/opticon.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index cbe779f578f9..4856fb7e637e 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c | |||
@@ -12,7 +12,6 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/init.h> | ||
16 | #include <linux/tty.h> | 15 | #include <linux/tty.h> |
17 | #include <linux/tty_driver.h> | 16 | #include <linux/tty_driver.h> |
18 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
@@ -139,7 +138,7 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
139 | /* Clear RTS line */ | 138 | /* Clear RTS line */ |
140 | send_control_msg(port, CONTROL_RTS, 0); | 139 | send_control_msg(port, CONTROL_RTS, 0); |
141 | 140 | ||
142 | /* clear the halt status of the enpoint */ | 141 | /* clear the halt status of the endpoint */ |
143 | usb_clear_halt(port->serial->dev, port->read_urb->pipe); | 142 | usb_clear_halt(port->serial->dev, port->read_urb->pipe); |
144 | 143 | ||
145 | res = usb_serial_generic_open(tty, port); | 144 | res = usb_serial_generic_open(tty, port); |
@@ -200,15 +199,12 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
200 | 199 | ||
201 | buffer = kmalloc(count, GFP_ATOMIC); | 200 | buffer = kmalloc(count, GFP_ATOMIC); |
202 | if (!buffer) { | 201 | if (!buffer) { |
203 | dev_err(&port->dev, "out of memory\n"); | ||
204 | count = -ENOMEM; | 202 | count = -ENOMEM; |
205 | |||
206 | goto error_no_buffer; | 203 | goto error_no_buffer; |
207 | } | 204 | } |
208 | 205 | ||
209 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 206 | urb = usb_alloc_urb(0, GFP_ATOMIC); |
210 | if (!urb) { | 207 | if (!urb) { |
211 | dev_err(&port->dev, "no more free urbs\n"); | ||
212 | count = -ENOMEM; | 208 | count = -ENOMEM; |
213 | goto error_no_urb; | 209 | goto error_no_urb; |
214 | } | 210 | } |
@@ -217,11 +213,10 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
217 | 213 | ||
218 | usb_serial_debug_data(&port->dev, __func__, count, buffer); | 214 | usb_serial_debug_data(&port->dev, __func__, count, buffer); |
219 | 215 | ||
220 | /* The conncected devices do not have a bulk write endpoint, | 216 | /* The connected devices do not have a bulk write endpoint, |
221 | * to transmit data to de barcode device the control endpoint is used */ | 217 | * to transmit data to de barcode device the control endpoint is used */ |
222 | dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO); | 218 | dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO); |
223 | if (!dr) { | 219 | if (!dr) { |
224 | dev_err(&port->dev, "out of memory\n"); | ||
225 | count = -ENOMEM; | 220 | count = -ENOMEM; |
226 | goto error_no_dr; | 221 | goto error_no_dr; |
227 | } | 222 | } |
@@ -367,8 +362,6 @@ static int opticon_ioctl(struct tty_struct *tty, | |||
367 | { | 362 | { |
368 | struct usb_serial_port *port = tty->driver_data; | 363 | struct usb_serial_port *port = tty->driver_data; |
369 | 364 | ||
370 | dev_dbg(&port->dev, "%s - cmd = 0x%x\n", __func__, cmd); | ||
371 | |||
372 | switch (cmd) { | 365 | switch (cmd) { |
373 | case TIOCGSERIAL: | 366 | case TIOCGSERIAL: |
374 | return get_serial_info(port, | 367 | return get_serial_info(port, |