From 10c642d0772ac1391ae4f9fdeb13217ab019117a Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Sun, 29 Dec 2013 19:22:56 +0100 Subject: USB: serial: remove redundant OOM messages Remove redundant error messages on allocation failures, which have already been logged. Cc: Joe Perches Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/mos7840.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'drivers/usb/serial/mos7840.c') diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index bc176ae61743..2496e71e406a 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -876,20 +876,14 @@ static int mos7840_open(struct tty_struct *tty, struct usb_serial_port *port) for (j = 0; j < NUM_URBS; ++j) { urb = usb_alloc_urb(0, GFP_KERNEL); mos7840_port->write_urb_pool[j] = urb; - - if (urb == NULL) { - dev_err(&port->dev, "No more urbs???\n"); + if (!urb) continue; - } urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL); if (!urb->transfer_buffer) { usb_free_urb(urb); mos7840_port->write_urb_pool[j] = NULL; - dev_err(&port->dev, - "%s-out of memory for urb buffers.\n", - __func__); continue; } } @@ -1381,12 +1375,8 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port, if (urb->transfer_buffer == NULL) { urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL); - - if (urb->transfer_buffer == NULL) { - dev_err_console(port, "%s no more kernel memory...\n", - __func__); + if (!urb->transfer_buffer) goto exit; - } } transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE); @@ -2206,10 +2196,8 @@ static int mos7840_port_probe(struct usb_serial_port *port) dev_dbg(&port->dev, "mos7840_startup: configuring port %d\n", pnum); mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL); - if (mos7840_port == NULL) { - dev_err(&port->dev, "%s - Out of memory\n", __func__); + if (!mos7840_port) return -ENOMEM; - } /* Initialize all port interrupt end point to port 0 int * endpoint. Our device has only one interrupt end point -- cgit v1.2.1