Staging: poch: Fix user space protocol syncing
authorVijay Kumar <vijaykumar@bravegnu.org>
Wed, 29 Oct 2008 03:28:39 +0000 (08:58 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Jan 2009 21:52:04 +0000 (13:52 -0800)
Always set the user space offset from kernel space, to indicate group
transmitted/received.

Signed-off-by: Vijay Kumar <vijaykumar@bravegnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/poch/poch.c

index 0a3eca14075e0bd8393e586cdc17ffb317a89cf7..3ecbd7c43c488d4806d0e7bfb71c6f5911c26f90 100644 (file)
@@ -948,14 +948,7 @@ static int poch_channel_available(struct channel_info *channel)
        spin_lock_irq(&channel->group_offsets_lock);
 
        for (i = 0; i < channel->group_count; i++) {
-               if (channel->dir == CHANNEL_DIR_RX
-                   && channel->header->group_offsets[i] == -1) {
-                       spin_unlock_irq(&channel->group_offsets_lock);
-                       return 1;
-               }
-
-               if (channel->dir == CHANNEL_DIR_TX
-                   && channel->header->group_offsets[i] != -1) {
+               if (channel->header->group_offsets[i] != -1) {
                        spin_unlock_irq(&channel->group_offsets_lock);
                        return 1;
                }
@@ -1103,10 +1096,7 @@ static void poch_irq_dma(struct channel_info *channel)
 
        for (i = 0; i < groups_done; i++) {
                j = (prev_transfer + i) % channel->group_count;
-               if (channel->dir == CHANNEL_DIR_RX)
-                       group_offsets[j] = -1;
-               else
-                       group_offsets[j] = groups[j].user_offset;
+               group_offsets[j] = groups[j].user_offset;
        }
 
        spin_unlock(&channel->group_offsets_lock);