The option gfp_flags is prepared in ep_queue and currently not used. This patch propagates the flag through all users down to the dma_pool_alloc function to consume it. Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx> --- Changes since v1: - rebased on the new alignment patch - wrapped function definition of hardware_enqueue - fixed comments for hardware_enqueue drivers/usb/chipidea/udc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 2257320..e779870 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -391,13 +391,16 @@ static void vbus_work(struct work_struct *work) * UTIL block *****************************************************************************/ /** - * _hardware_queue: configures a request at hardware level + * _hardware_enqueue: configures a request at hardware level * @gadget: gadget * @mEp: endpoint + * @gfp_flags: memory allocation flags * * This function returns an error code */ -static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq) +static int +_hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq, + gfp_t gfp_flags) { struct ci13xxx *ci = mEp->ci; unsigned i; @@ -411,7 +414,7 @@ static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq) mReq->req.status = -EALREADY; if (mReq->req.zero && length && (length % mEp->ep.maxpacket == 0)) { - mReq->zptr = dma_pool_alloc(mEp->td_pool, GFP_ATOMIC, + mReq->zptr = dma_pool_alloc(mEp->td_pool, gfp_flags, &mReq->zdma); if (mReq->zptr == NULL) return -ENOMEM; @@ -661,7 +664,7 @@ static void isr_get_status_complete(struct usb_ep *ep, struct usb_request *req) * Caller must hold lock */ static int _ep_queue(struct usb_ep *ep, struct usb_request *req, - gfp_t __maybe_unused gfp_flags) + gfp_t gfp_flags) { struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep); struct ci13xxx_req *mReq = container_of(req, struct ci13xxx_req, req); @@ -706,7 +709,7 @@ static int _ep_queue(struct usb_ep *ep, struct usb_request *req, mReq->req.status = -EINPROGRESS; mReq->req.actual = 0; - retval = _hardware_enqueue(mEp, mReq); + retval = _hardware_enqueue(mEp, mReq, gfp_flags); if (retval == -EALREADY) { trace_ci_ep_queue_req(mEp, retval); @@ -1217,7 +1220,7 @@ static void ep_free_request(struct usb_ep *ep, struct usb_request *req) * Check usb_ep_queue()* at usb_gadget.h" for details */ static int ep_queue(struct usb_ep *ep, struct usb_request *req, - gfp_t __maybe_unused gfp_flags) + gfp_t gfp_flags) { struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep); int retval = 0; -- 1.8.2.rc2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html