Commit 559f64d4 authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab

[media] RedRat3: Delete six messages for a failed memory allocation

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such a logging statement in five functions.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 0bebaa5f
...@@ -480,10 +480,8 @@ static u32 redrat3_get_timeout(struct redrat3_dev *rr3) ...@@ -480,10 +480,8 @@ static u32 redrat3_get_timeout(struct redrat3_dev *rr3)
len = sizeof(*tmp); len = sizeof(*tmp);
tmp = kzalloc(len, GFP_KERNEL); tmp = kzalloc(len, GFP_KERNEL);
if (!tmp) { if (!tmp)
dev_warn(rr3->dev, "Memory allocation faillure\n");
return timeout; return timeout;
}
pipe = usb_rcvctrlpipe(rr3->udev, 0); pipe = usb_rcvctrlpipe(rr3->udev, 0);
ret = usb_control_msg(rr3->udev, pipe, RR3_GET_IR_PARAM, ret = usb_control_msg(rr3->udev, pipe, RR3_GET_IR_PARAM,
...@@ -544,10 +542,8 @@ static void redrat3_reset(struct redrat3_dev *rr3) ...@@ -544,10 +542,8 @@ static void redrat3_reset(struct redrat3_dev *rr3)
txpipe = usb_sndctrlpipe(udev, 0); txpipe = usb_sndctrlpipe(udev, 0);
val = kmalloc(len, GFP_KERNEL); val = kmalloc(len, GFP_KERNEL);
if (!val) { if (!val)
dev_err(dev, "Memory allocation failure\n");
return; return;
}
*val = 0x01; *val = 0x01;
rc = usb_control_msg(udev, rxpipe, RR3_RESET, rc = usb_control_msg(udev, rxpipe, RR3_RESET,
...@@ -589,10 +585,8 @@ static void redrat3_get_firmware_rev(struct redrat3_dev *rr3) ...@@ -589,10 +585,8 @@ static void redrat3_get_firmware_rev(struct redrat3_dev *rr3)
char *buffer; char *buffer;
buffer = kcalloc(RR3_FW_VERSION_LEN + 1, sizeof(*buffer), GFP_KERNEL); buffer = kcalloc(RR3_FW_VERSION_LEN + 1, sizeof(*buffer), GFP_KERNEL);
if (!buffer) { if (!buffer)
dev_err(rr3->dev, "Memory allocation failure\n");
return; return;
}
rc = usb_control_msg(rr3->udev, usb_rcvctrlpipe(rr3->udev, 0), rc = usb_control_msg(rr3->udev, usb_rcvctrlpipe(rr3->udev, 0),
RR3_FW_VERSION, RR3_FW_VERSION,
...@@ -909,10 +903,8 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3) ...@@ -909,10 +903,8 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3)
u16 prod = le16_to_cpu(rr3->udev->descriptor.idProduct); u16 prod = le16_to_cpu(rr3->udev->descriptor.idProduct);
rc = rc_allocate_device(); rc = rc_allocate_device();
if (!rc) { if (!rc)
dev_err(dev, "remote input dev allocation failed\n");
goto out; goto out;
}
snprintf(rr3->name, sizeof(rr3->name), "RedRat3%s Infrared Remote Transceiver (%04x:%04x)", snprintf(rr3->name, sizeof(rr3->name), "RedRat3%s Infrared Remote Transceiver (%04x:%04x)",
prod == USB_RR3IIUSB_PRODUCT_ID ? "-II" : "", prod == USB_RR3IIUSB_PRODUCT_ID ? "-II" : "",
...@@ -1001,10 +993,8 @@ static int redrat3_dev_probe(struct usb_interface *intf, ...@@ -1001,10 +993,8 @@ static int redrat3_dev_probe(struct usb_interface *intf,
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
rr3 = kzalloc(sizeof(*rr3), GFP_KERNEL); rr3 = kzalloc(sizeof(*rr3), GFP_KERNEL);
if (rr3 == NULL) { if (!rr3)
dev_err(dev, "Memory allocation failure\n");
goto no_endpoints; goto no_endpoints;
}
rr3->dev = &intf->dev; rr3->dev = &intf->dev;
...@@ -1016,10 +1006,8 @@ static int redrat3_dev_probe(struct usb_interface *intf, ...@@ -1016,10 +1006,8 @@ static int redrat3_dev_probe(struct usb_interface *intf,
rr3->ep_in = ep_in; rr3->ep_in = ep_in;
rr3->bulk_in_buf = usb_alloc_coherent(udev, rr3->bulk_in_buf = usb_alloc_coherent(udev,
le16_to_cpu(ep_in->wMaxPacketSize), GFP_KERNEL, &rr3->dma_in); le16_to_cpu(ep_in->wMaxPacketSize), GFP_KERNEL, &rr3->dma_in);
if (!rr3->bulk_in_buf) { if (!rr3->bulk_in_buf)
dev_err(dev, "Read buffer allocation failure\n");
goto error; goto error;
}
pipe = usb_rcvbulkpipe(udev, ep_in->bEndpointAddress); pipe = usb_rcvbulkpipe(udev, ep_in->bEndpointAddress);
usb_fill_bulk_urb(rr3->read_urb, udev, pipe, rr3->bulk_in_buf, usb_fill_bulk_urb(rr3->read_urb, udev, pipe, rr3->bulk_in_buf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment