diff options
author | Oliver Neukum <oneukum@suse.de> | 2015-01-28 10:56:24 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-31 11:58:39 -0500 |
commit | 17136d4984b37d2a9acb67e1da1a3e95e3fed918 (patch) | |
tree | e58dc48b66c412217ed58b70a82d0e8f0d59dcc8 | |
parent | 7e860a6e7aa62b337a61110430cd633db5b0d2dd (diff) |
cdc-acm: kill unnecessary messages
Memory allocation failures are reported by a central facility.
No need to repeat the job.
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index a417b738824f..e78720b59d67 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1298,10 +1298,8 @@ made_compressed_probe: | |||
1298 | dev_dbg(&intf->dev, "interfaces are valid\n"); | 1298 | dev_dbg(&intf->dev, "interfaces are valid\n"); |
1299 | 1299 | ||
1300 | acm = kzalloc(sizeof(struct acm), GFP_KERNEL); | 1300 | acm = kzalloc(sizeof(struct acm), GFP_KERNEL); |
1301 | if (acm == NULL) { | 1301 | if (acm == NULL) |
1302 | dev_err(&intf->dev, "out of memory (acm kzalloc)\n"); | ||
1303 | goto alloc_fail; | 1302 | goto alloc_fail; |
1304 | } | ||
1305 | 1303 | ||
1306 | minor = acm_alloc_minor(acm); | 1304 | minor = acm_alloc_minor(acm); |
1307 | if (minor == ACM_TTY_MINORS) { | 1305 | if (minor == ACM_TTY_MINORS) { |
@@ -1340,42 +1338,32 @@ made_compressed_probe: | |||
1340 | acm->quirks = quirks; | 1338 | acm->quirks = quirks; |
1341 | 1339 | ||
1342 | buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); | 1340 | buf = usb_alloc_coherent(usb_dev, ctrlsize, GFP_KERNEL, &acm->ctrl_dma); |
1343 | if (!buf) { | 1341 | if (!buf) |
1344 | dev_err(&intf->dev, "out of memory (ctrl buffer alloc)\n"); | ||
1345 | goto alloc_fail2; | 1342 | goto alloc_fail2; |
1346 | } | ||
1347 | acm->ctrl_buffer = buf; | 1343 | acm->ctrl_buffer = buf; |
1348 | 1344 | ||
1349 | if (acm_write_buffers_alloc(acm) < 0) { | 1345 | if (acm_write_buffers_alloc(acm) < 0) |
1350 | dev_err(&intf->dev, "out of memory (write buffer alloc)\n"); | ||
1351 | goto alloc_fail4; | 1346 | goto alloc_fail4; |
1352 | } | ||
1353 | 1347 | ||
1354 | acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL); | 1348 | acm->ctrlurb = usb_alloc_urb(0, GFP_KERNEL); |
1355 | if (!acm->ctrlurb) { | 1349 | if (!acm->ctrlurb) |
1356 | dev_err(&intf->dev, "out of memory (ctrlurb kmalloc)\n"); | ||
1357 | goto alloc_fail5; | 1350 | goto alloc_fail5; |
1358 | } | 1351 | |
1359 | for (i = 0; i < num_rx_buf; i++) { | 1352 | for (i = 0; i < num_rx_buf; i++) { |
1360 | struct acm_rb *rb = &(acm->read_buffers[i]); | 1353 | struct acm_rb *rb = &(acm->read_buffers[i]); |
1361 | struct urb *urb; | 1354 | struct urb *urb; |
1362 | 1355 | ||
1363 | rb->base = usb_alloc_coherent(acm->dev, readsize, GFP_KERNEL, | 1356 | rb->base = usb_alloc_coherent(acm->dev, readsize, GFP_KERNEL, |
1364 | &rb->dma); | 1357 | &rb->dma); |
1365 | if (!rb->base) { | 1358 | if (!rb->base) |
1366 | dev_err(&intf->dev, "out of memory " | ||
1367 | "(read bufs usb_alloc_coherent)\n"); | ||
1368 | goto alloc_fail6; | 1359 | goto alloc_fail6; |
1369 | } | ||
1370 | rb->index = i; | 1360 | rb->index = i; |
1371 | rb->instance = acm; | 1361 | rb->instance = acm; |
1372 | 1362 | ||
1373 | urb = usb_alloc_urb(0, GFP_KERNEL); | 1363 | urb = usb_alloc_urb(0, GFP_KERNEL); |
1374 | if (!urb) { | 1364 | if (!urb) |
1375 | dev_err(&intf->dev, | ||
1376 | "out of memory (read urbs usb_alloc_urb)\n"); | ||
1377 | goto alloc_fail6; | 1365 | goto alloc_fail6; |
1378 | } | 1366 | |
1379 | urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 1367 | urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
1380 | urb->transfer_dma = rb->dma; | 1368 | urb->transfer_dma = rb->dma; |
1381 | if (acm->is_int_ep) { | 1369 | if (acm->is_int_ep) { |
@@ -1400,11 +1388,8 @@ made_compressed_probe: | |||
1400 | struct acm_wb *snd = &(acm->wb[i]); | 1388 | struct acm_wb *snd = &(acm->wb[i]); |
1401 | 1389 | ||
1402 | snd->urb = usb_alloc_urb(0, GFP_KERNEL); | 1390 | snd->urb = usb_alloc_urb(0, GFP_KERNEL); |
1403 | if (snd->urb == NULL) { | 1391 | if (snd->urb == NULL) |
1404 | dev_err(&intf->dev, | ||
1405 | "out of memory (write urbs usb_alloc_urb)\n"); | ||
1406 | goto alloc_fail7; | 1392 | goto alloc_fail7; |
1407 | } | ||
1408 | 1393 | ||
1409 | if (usb_endpoint_xfer_int(epwrite)) | 1394 | if (usb_endpoint_xfer_int(epwrite)) |
1410 | usb_fill_int_urb(snd->urb, usb_dev, | 1395 | usb_fill_int_urb(snd->urb, usb_dev, |