Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190139
b: refs/heads/master
c: d6372b6
h: refs/heads/master
i:
  190137: 74ff9d1
  190135: 9dec3c7
v: v3
  • Loading branch information
Clemens Ladisch authored and Stefan Richter committed Apr 19, 2010
1 parent 5a6bdfd commit d12f481
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3a1f0a0e3d871e3d3e08a1429009992151becda8
refs/heads/master: d6372b6e7c6142e6cc2108b3b850584cd7ade106
10 changes: 7 additions & 3 deletions trunk/drivers/firewire/core-iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static int manage_bandwidth(struct fw_card *card, int irm_id, int generation,
for (try = 0; try < 5; try++) {
new = allocate ? old - bandwidth : old + bandwidth;
if (new < 0 || new > BANDWIDTH_AVAILABLE_INITIAL)
break;
return -EBUSY;

data[0] = cpu_to_be32(old);
data[1] = cpu_to_be32(new);
Expand Down Expand Up @@ -217,14 +217,16 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,
u32 channels_mask, u64 offset, bool allocate, __be32 data[2])
{
__be32 c, all, old;
int i, retry = 5;
int i, ret = -EIO, retry = 5;

old = all = allocate ? cpu_to_be32(~0) : 0;

for (i = 0; i < 32; i++) {
if (!(channels_mask & 1 << i))
continue;

ret = -EBUSY;

c = cpu_to_be32(1 << (31 - i));
if ((old & c) != (all & c))
continue;
Expand Down Expand Up @@ -253,11 +255,13 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation,
if (retry) {
retry--;
i--;
} else {
ret = -EIO;
}
}
}

return -EIO;
return ret;
}

static void deallocate_channel(struct fw_card *card, int irm_id,
Expand Down

0 comments on commit d12f481

Please sign in to comment.