aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorWolfram Sang <wsa-dev@sang-engineering.com>2016-08-25 13:39:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-30 13:17:37 -0400
commitd9116ca87e8dfee907106dbc912a926c3b67c52c (patch)
treef85d09b03b2f35f5b2ded69da089ba71a5e87e47 /drivers/usb
parent648e0bc96169668531ef6ea9524b8c0a81c92324 (diff)
usb: gadget: udc: fsl_qe_udc: don't print on ENOMEM
All kmalloc-based functions print enough information on failures. Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/fsl_qe_udc.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c
index cf8819a5c5b2..9d6b2c8eed42 100644
--- a/drivers/usb/gadget/udc/fsl_qe_udc.c
+++ b/drivers/usb/gadget/udc/fsl_qe_udc.c
@@ -421,10 +421,8 @@ static int qe_ep_rxbd_update(struct qe_ep *ep)
421 bd = ep->rxbase; 421 bd = ep->rxbase;
422 422
423 ep->rxframe = kmalloc(sizeof(*ep->rxframe), GFP_ATOMIC); 423 ep->rxframe = kmalloc(sizeof(*ep->rxframe), GFP_ATOMIC);
424 if (ep->rxframe == NULL) { 424 if (!ep->rxframe)
425 dev_err(ep->udc->dev, "malloc rxframe failed\n");
426 return -ENOMEM; 425 return -ENOMEM;
427 }
428 426
429 qe_frame_init(ep->rxframe); 427 qe_frame_init(ep->rxframe);
430 428
@@ -435,9 +433,7 @@ static int qe_ep_rxbd_update(struct qe_ep *ep)
435 433
436 size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (bdring_len + 1); 434 size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (bdring_len + 1);
437 ep->rxbuffer = kzalloc(size, GFP_ATOMIC); 435 ep->rxbuffer = kzalloc(size, GFP_ATOMIC);
438 if (ep->rxbuffer == NULL) { 436 if (!ep->rxbuffer) {
439 dev_err(ep->udc->dev, "malloc rxbuffer failed,size=%d\n",
440 size);
441 kfree(ep->rxframe); 437 kfree(ep->rxframe);
442 return -ENOMEM; 438 return -ENOMEM;
443 } 439 }
@@ -668,10 +664,8 @@ static int qe_ep_init(struct qe_udc *udc,
668 664
669 if ((ep->tm == USBP_TM_CTL) || (ep->dir == USB_DIR_IN)) { 665 if ((ep->tm == USBP_TM_CTL) || (ep->dir == USB_DIR_IN)) {
670 ep->txframe = kmalloc(sizeof(*ep->txframe), GFP_ATOMIC); 666 ep->txframe = kmalloc(sizeof(*ep->txframe), GFP_ATOMIC);
671 if (ep->txframe == NULL) { 667 if (!ep->txframe)
672 dev_err(udc->dev, "malloc txframe failed\n");
673 goto en_done2; 668 goto en_done2;
674 }
675 qe_frame_init(ep->txframe); 669 qe_frame_init(ep->txframe);
676 } 670 }
677 671
@@ -2347,10 +2341,8 @@ static struct qe_udc *qe_udc_config(struct platform_device *ofdev)
2347 u32 offset; 2341 u32 offset;
2348 2342
2349 udc = kzalloc(sizeof(*udc), GFP_KERNEL); 2343 udc = kzalloc(sizeof(*udc), GFP_KERNEL);
2350 if (udc == NULL) { 2344 if (!udc)
2351 dev_err(&ofdev->dev, "malloc udc failed\n");
2352 goto cleanup; 2345 goto cleanup;
2353 }
2354 2346
2355 udc->dev = &ofdev->dev; 2347 udc->dev = &ofdev->dev;
2356 2348