usb: dwc2: gadget: don't print on ENOMEM
authorWolfram Sang <wsa-dev@sang-engineering.com>
Thu, 25 Aug 2016 17:39:02 +0000 (19:39 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 29 Aug 2016 07:47:45 +0000 (10:47 +0300)
All kmalloc-based functions print enough information on failures.

Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/gadget.c

index af46adfae41ca5fd92b1401eff078e84bf27c7aa..2ff03ae08e144d8541c6f8bfca5afb6874e87049 100644 (file)
@@ -3908,17 +3908,13 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
 
        hsotg->ctrl_buff = devm_kzalloc(hsotg->dev,
                        DWC2_CTRL_BUFF_SIZE, GFP_KERNEL);
-       if (!hsotg->ctrl_buff) {
-               dev_err(dev, "failed to allocate ctrl request buff\n");
+       if (!hsotg->ctrl_buff)
                return -ENOMEM;
-       }
 
        hsotg->ep0_buff = devm_kzalloc(hsotg->dev,
                        DWC2_CTRL_BUFF_SIZE, GFP_KERNEL);
-       if (!hsotg->ep0_buff) {
-               dev_err(dev, "failed to allocate ctrl reply buff\n");
+       if (!hsotg->ep0_buff)
                return -ENOMEM;
-       }
 
        ret = devm_request_irq(hsotg->dev, irq, dwc2_hsotg_irq, IRQF_SHARED,
                                dev_name(hsotg->dev), hsotg);