Re: [PATCH 06/30] usb: dwc2: gadget: Add DMA descriptor chains for EP 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

John Youn <johnyoun@xxxxxxxxxxxx> writes:
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index 3ab4d60..85fc459 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -324,6 +324,56 @@ static void dwc2_hsotg_unmap_dma(struct dwc2_hsotg *hsotg,
>  	usb_gadget_unmap_request(&hsotg->gadget, req, hs_ep->dir_in);
>  }
>  
> +/*
> + * dwc2_gadget_alloc_ctrl_desc_chains - allocate DMA descriptor chains
> + * for Control endpoint
> + * @hsotg: The device state.
> + *
> + * This function will allocate 4 descriptor chains for EP 0: 2 for
> + * Setup stage, per one for IN and OUT data/status transactions.
> + */
> +static int dwc2_gadget_alloc_ctrl_desc_chains(struct dwc2_hsotg *hsotg)
> +{
> +	hsotg->setup_desc[0] =
> +		dmam_alloc_coherent(hsotg->dev,
> +				    sizeof(struct dwc2_dma_desc),
> +				    &hsotg->setup_desc_dma[0],
> +				    GFP_ATOMIC);

doesn't seem like any of this needs to be GFP_ATOMIC

> +fail:
> +	dev_err(hsotg->dev, "%s: allocation failed for EP0 descs\n", __func__);

-ENOMEM error messages are already printed for you, just remove this line.

-- 
balbi

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux