[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F744E23.3040207@mvista.com>
Date: Thu, 29 Mar 2012 15:57:23 +0400
From: Sergei Shtylyov <sshtylyov@...sta.com>
To: Tomoki Sekiyama <tomoki.sekiyama@...il.com>
CC: gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] USB: yurex: remove allocation of coherent buffer for
setup-packet buffer
Hello.
On 29-03-2012 3:20, Tomoki Sekiyama wrote:
> Removes allocation of coherent buffer for the control-request setup-packet
> buffer from the yurex driver. Using coherent buffers for setup-packet is
> obsoleted and does not work with some USB host implementations.
> This patch also fixes missing URB_NO_TRANSFER_DMA_MAP flag in urb.
Looks like the patch should be split into two then as it does two different
things.
> Signed-off-by: Tomoki Sekiyama<tomoki.sekiyama@...il.com>
> ---
> drivers/usb/misc/yurex.c | 10 +++-------
> 1 files changed, 3 insertions(+), 7 deletions(-)
> diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
> index 897edda..7020146 100644
> --- a/drivers/usb/misc/yurex.c
> +++ b/drivers/usb/misc/yurex.c
> @@ -99,9 +99,7 @@ static void yurex_delete(struct kref *kref)
> usb_put_dev(dev->udev);
> if (dev->cntl_urb) {
> usb_kill_urb(dev->cntl_urb);
> - if (dev->cntl_req)
> - usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
> - dev->cntl_req, dev->cntl_urb->setup_dma);
> + kfree(dev->cntl_req);
> if (dev->cntl_buffer)
> usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
> dev->cntl_buffer, dev->cntl_urb->transfer_dma);
> @@ -234,9 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
> }
>
> /* allocate buffer for control req */
> - dev->cntl_req = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
> - GFP_KERNEL,
> - &dev->cntl_urb->setup_dma);
> + dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL);
> if (!dev->cntl_req) {
> err("Could not allocate cntl_req");
> goto error;
> @@ -286,7 +282,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
> usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr),
> dev->int_buffer, YUREX_BUF_SIZE, yurex_interrupt,
> dev, 1);
> - dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
> + dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
> if (usb_submit_urb(dev->urb, GFP_KERNEL)) {
> retval = -EIO;
> err("Could not submitting URB");
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists