Date:2011-07-06 16:06:33 (11 years 2 months ago)
Author:Stefan Schmidt
Commit:a7cf06c0218ec0246ba1fe414500a3798b53d3d1
Message:drivers/spi/atusb: Remove ctrl_urb from local struct.

Its only needed in submit_control_urb()

Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Files: drivers/spi/atusb.c (3 diffs)

Change Details

drivers/spi/atusb.c
4949    struct at86rf230_platform_data platform_data;
5050    /* copy platform_data so that we can adapt .reset_data */
5151    struct spi_device *spi;
52    struct urb *ctrl_urb;
5352    size_t bulk_in_filled; /* number of bytes in the buffer */
5453    struct completion urb_completion;
5554// unsigned char buffer[3];
...... 
220219{
221220    struct usb_device *dev = atusb->udev;
222221    struct usb_ctrlrequest *req;
222    struct urb *ctrl_urb;
223223    int retval = -ENOMEM;
224224
225225    req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
...... 
232232    req->wIndex = cpu_to_le16(index);
233233    req->wLength = cpu_to_le16(size);
234234
235    atusb->ctrl_urb = usb_alloc_urb(0, GFP_KERNEL);
236    if (!atusb->ctrl_urb)
235    ctrl_urb = usb_alloc_urb(0, GFP_KERNEL);
236    if (!ctrl_urb)
237237        goto out_nourb;
238238
239    usb_fill_control_urb(atusb->ctrl_urb, dev,
239    usb_fill_control_urb(ctrl_urb, dev,
240240        requesttype == ATUSB_FROM_DEV ?
241241          usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0),
242242        (unsigned char *) req, data, size, complete_fn, context);
243243
244    retval = usb_submit_urb(atusb->ctrl_urb, GFP_KERNEL);
244    retval = usb_submit_urb(ctrl_urb, GFP_KERNEL);
245245    if (!retval)
246246        return 0;
247247    dev_info(&dev->dev, "failed submitting read urb, error %d",
248248        retval);
249249    retval = retval == -ENOMEM ? retval : -EIO;
250250
251    usb_free_urb(atusb->ctrl_urb);
251    usb_free_urb(ctrl_urb);
252252out_nourb:
253253    kfree(req);
254254

Archive Download the corresponding diff file



interactive