diff options
-rw-r--r-- | drivers/firewire/core-iso.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 34a513725c9e..9198e030e895 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c | |||
@@ -189,7 +189,7 @@ static int manage_bandwidth(struct fw_card *card, int irm_id, int generation, | |||
189 | for (try = 0; try < 5; try++) { | 189 | for (try = 0; try < 5; try++) { |
190 | new = allocate ? old - bandwidth : old + bandwidth; | 190 | new = allocate ? old - bandwidth : old + bandwidth; |
191 | if (new < 0 || new > BANDWIDTH_AVAILABLE_INITIAL) | 191 | if (new < 0 || new > BANDWIDTH_AVAILABLE_INITIAL) |
192 | break; | 192 | return -EBUSY; |
193 | 193 | ||
194 | data[0] = cpu_to_be32(old); | 194 | data[0] = cpu_to_be32(old); |
195 | data[1] = cpu_to_be32(new); | 195 | data[1] = cpu_to_be32(new); |
@@ -217,7 +217,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, | |||
217 | u32 channels_mask, u64 offset, bool allocate, __be32 data[2]) | 217 | u32 channels_mask, u64 offset, bool allocate, __be32 data[2]) |
218 | { | 218 | { |
219 | __be32 c, all, old; | 219 | __be32 c, all, old; |
220 | int i, retry = 5; | 220 | int i, ret = -EIO, retry = 5; |
221 | 221 | ||
222 | old = all = allocate ? cpu_to_be32(~0) : 0; | 222 | old = all = allocate ? cpu_to_be32(~0) : 0; |
223 | 223 | ||
@@ -225,6 +225,8 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, | |||
225 | if (!(channels_mask & 1 << i)) | 225 | if (!(channels_mask & 1 << i)) |
226 | continue; | 226 | continue; |
227 | 227 | ||
228 | ret = -EBUSY; | ||
229 | |||
228 | c = cpu_to_be32(1 << (31 - i)); | 230 | c = cpu_to_be32(1 << (31 - i)); |
229 | if ((old & c) != (all & c)) | 231 | if ((old & c) != (all & c)) |
230 | continue; | 232 | continue; |
@@ -253,11 +255,13 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, | |||
253 | if (retry) { | 255 | if (retry) { |
254 | retry--; | 256 | retry--; |
255 | i--; | 257 | i--; |
258 | } else { | ||
259 | ret = -EIO; | ||
256 | } | 260 | } |
257 | } | 261 | } |
258 | } | 262 | } |
259 | 263 | ||
260 | return -EIO; | 264 | return ret; |
261 | } | 265 | } |
262 | 266 | ||
263 | static void deallocate_channel(struct fw_card *card, int irm_id, | 267 | static void deallocate_channel(struct fw_card *card, int irm_id, |