diff options
author | Christian Gromm <christian.gromm@microchip.com> | 2016-09-19 15:40:23 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-20 06:39:42 (GMT) |
commit | d223b37c9f44273c0cca5138118d6c75e5110bfa (patch) | |
tree | 5848b29bb23ad59452998b4c797e6ec735bbac16 | |
parent | 27e6245e35bc6c20c2933d7d8afa562623be1ef5 (diff) | |
download | linux-d223b37c9f44273c0cca5138118d6c75e5110bfa.tar.xz |
staging: most: hdm-usb: remove redundant spinlocks
This patch removes the spinlocks when accessing the usb_anchor list,
because the struct usb_anchor is using its own lock.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/most/hdm-usb/hdm_usb.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c index 58f65a4..f872ce9 100644 --- a/drivers/staging/most/hdm-usb/hdm_usb.c +++ b/drivers/staging/most/hdm-usb/hdm_usb.c @@ -197,12 +197,8 @@ static void free_anchored_buffers(struct most_dev *mdev, unsigned int channel, { struct mbo *mbo; struct urb *urb; - spinlock_t *lock = mdev->anchor_list_lock + channel; /* temp. lock */ - unsigned long flags; - spin_lock_irqsave(lock, flags); while ((urb = usb_get_from_anchor(&mdev->busy_urbs[channel]))) { - spin_unlock_irqrestore(lock, flags); mbo = urb->context; usb_kill_urb(urb); if (mbo && mbo->complete) { @@ -211,9 +207,7 @@ static void free_anchored_buffers(struct most_dev *mdev, unsigned int channel, mbo->complete(mbo); } usb_free_urb(urb); - spin_lock_irqsave(lock, flags); } - spin_unlock_irqrestore(lock, flags); } /** @@ -605,10 +599,8 @@ static int hdm_enqueue(struct most_interface *iface, int channel, struct device *dev; int retval = 0; struct urb *urb; - unsigned long flags; unsigned long length; void *virt_address; - spinlock_t *lock; /* temp. lock */ if (unlikely(!iface || !mbo)) return -EIO; @@ -657,10 +649,7 @@ static int hdm_enqueue(struct most_interface *iface, int channel, } urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - lock = mdev->anchor_list_lock + channel; - spin_lock_irqsave(lock, flags); usb_anchor_urb(urb, &mdev->busy_urbs[channel]); - spin_unlock_irqrestore(lock, flags); retval = usb_submit_urb(urb, GFP_KERNEL); if (retval) { @@ -670,9 +659,7 @@ static int hdm_enqueue(struct most_interface *iface, int channel, return 0; _error_1: - spin_lock_irqsave(lock, flags); usb_unanchor_urb(urb); - spin_unlock_irqrestore(lock, flags); _error: usb_free_urb(urb); return retval; |