[PATCH 4/8] staging: most: hdm-usb: remove completion object

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

 



Waiting for the urb_compl object to complete evaluates always as false.
This patch removes this unnecessary completion object.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@xxxxxx>
Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
index 26b5c1b..29e98dc 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -72,7 +72,6 @@
 struct buf_anchor {
 	struct urb *urb;
 	struct list_head list;
-	struct completion urb_compl;
 };
 
 /**
@@ -217,12 +216,7 @@ static void free_anchored_buffers(struct most_dev *mdev, unsigned int channel,
 		spin_unlock_irqrestore(lock, flags);
 		if (likely(urb)) {
 			mbo = urb->context;
-			if (!irqs_disabled()) {
-				usb_kill_urb(urb);
-			} else {
-				usb_unlink_urb(urb);
-				wait_for_completion(&anchor->urb_compl);
-			}
+			usb_kill_urb(urb);
 			if ((mbo) && (mbo->complete)) {
 				mbo->status = status;
 				mbo->processed_length = 0;
@@ -416,7 +410,6 @@ static void hdm_write_completion(struct urb *urb)
 	if ((urb->status == -ENOENT) || (urb->status == -ECONNRESET) ||
 	    (!mdev->is_channel_healthy[channel])) {
 		spin_unlock_irqrestore(lock, flags);
-		complete(&anchor->urb_compl);
 		return;
 	}
 
@@ -582,7 +575,6 @@ static void hdm_read_completion(struct urb *urb)
 	if ((urb->status == -ENOENT) || (urb->status == -ECONNRESET) ||
 	    (!mdev->is_channel_healthy[channel])) {
 		spin_unlock_irqrestore(lock, flags);
-		complete(&anchor->urb_compl);
 		return;
 	}
 
@@ -678,7 +670,6 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
 	}
 
 	anchor->urb = urb;
-	init_completion(&anchor->urb_compl);
 	mbo->priv = anchor;
 
 	if ((mdev->padding_active[channel]) &&
-- 
1.9.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux