From d12f48128688874a9334ae0adb57a062741c2b2f Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 12 Apr 2010 10:35:18 +0200 Subject: [PATCH] --- yaml --- r: 190139 b: refs/heads/master c: d6372b6e7c6142e6cc2108b3b850584cd7ade106 h: refs/heads/master i: 190137: 74ff9d1142c8208fab04cc440671690f95433c61 190135: 9dec3c75cfcf178cff2b77d4696977708f907ee6 v: v3 --- [refs] | 2 +- trunk/drivers/firewire/core-iso.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index d99d3ea096d3..a222e63f7a95 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3a1f0a0e3d871e3d3e08a1429009992151becda8 +refs/heads/master: d6372b6e7c6142e6cc2108b3b850584cd7ade106 diff --git a/trunk/drivers/firewire/core-iso.c b/trunk/drivers/firewire/core-iso.c index 34a513725c9e..9198e030e895 100644 --- a/trunk/drivers/firewire/core-iso.c +++ b/trunk/drivers/firewire/core-iso.c @@ -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); @@ -217,7 +217,7 @@ 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; @@ -225,6 +225,8 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, if (!(channels_mask & 1 << i)) continue; + ret = -EBUSY; + c = cpu_to_be32(1 << (31 - i)); if ((old & c) != (all & c)) continue; @@ -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,