summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/garmin_gps.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-12-29 22:22:56 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-04 00:31:46 +0400
commit10c642d0772ac1391ae4f9fdeb13217ab019117a (patch)
treef7fe3b80ca13ff03fde6ec4b5d46aa1063a4c4dc /drivers/usb/serial/garmin_gps.c
parent4d5147ec90531d11e7677e2c38941fc18e160641 (diff)
downloadlinux-10c642d0772ac1391ae4f9fdeb13217ab019117a.tar.xz
USB: serial: remove redundant OOM messages
Remove redundant error messages on allocation failures, which have already been logged. Cc: Joe Perches <joe@perches.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/garmin_gps.c')
-rw-r--r--drivers/usb/serial/garmin_gps.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 04b5ed90ffb2..f4ee74da44e8 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -279,10 +279,9 @@ static int pkt_add(struct garmin_data *garmin_data_p,
if (data_length) {
pkt = kmalloc(sizeof(struct garmin_packet)+data_length,
GFP_ATOMIC);
- if (pkt == NULL) {
- dev_err(&garmin_data_p->port->dev, "out of memory\n");
+ if (!pkt)
return 0;
- }
+
pkt->size = data_length;
memcpy(pkt->data, data, data_length);
@@ -1006,14 +1005,11 @@ static int garmin_write_bulk(struct usb_serial_port *port,
spin_unlock_irqrestore(&garmin_data_p->lock, flags);
buffer = kmalloc(count, GFP_ATOMIC);
- if (!buffer) {
- dev_err(&port->dev, "out of memory\n");
+ if (!buffer)
return -ENOMEM;
- }
urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) {
- dev_err(&port->dev, "no more free urbs\n");
kfree(buffer);
return -ENOMEM;
}
@@ -1393,10 +1389,9 @@ static int garmin_port_probe(struct usb_serial_port *port)
struct garmin_data *garmin_data_p;
garmin_data_p = kzalloc(sizeof(struct garmin_data), GFP_KERNEL);
- if (garmin_data_p == NULL) {
- dev_err(&port->dev, "%s - Out of memory\n", __func__);
+ if (!garmin_data_p)
return -ENOMEM;
- }
+
init_timer(&garmin_data_p->timer);
spin_lock_init(&garmin_data_p->lock);
INIT_LIST_HEAD(&garmin_data_p->pktlist);