diff options
Diffstat (limited to 'drivers/firewire/core-iso.c')
-rw-r--r-- | drivers/firewire/core-iso.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 3784a47865b7..8f5aebfb29df 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c | |||
@@ -190,7 +190,7 @@ static int manage_bandwidth(struct fw_card *card, int irm_id, int generation, | |||
190 | for (try = 0; try < 5; try++) { | 190 | for (try = 0; try < 5; try++) { |
191 | new = allocate ? old - bandwidth : old + bandwidth; | 191 | new = allocate ? old - bandwidth : old + bandwidth; |
192 | if (new < 0 || new > BANDWIDTH_AVAILABLE_INITIAL) | 192 | if (new < 0 || new > BANDWIDTH_AVAILABLE_INITIAL) |
193 | break; | 193 | return -EBUSY; |
194 | 194 | ||
195 | data[0] = cpu_to_be32(old); | 195 | data[0] = cpu_to_be32(old); |
196 | data[1] = cpu_to_be32(new); | 196 | data[1] = cpu_to_be32(new); |
@@ -218,7 +218,7 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, | |||
218 | u32 channels_mask, u64 offset, bool allocate, __be32 data[2]) | 218 | u32 channels_mask, u64 offset, bool allocate, __be32 data[2]) |
219 | { | 219 | { |
220 | __be32 c, all, old; | 220 | __be32 c, all, old; |
221 | int i, retry = 5; | 221 | int i, ret = -EIO, retry = 5; |
222 | 222 | ||
223 | old = all = allocate ? cpu_to_be32(~0) : 0; | 223 | old = all = allocate ? cpu_to_be32(~0) : 0; |
224 | 224 | ||
@@ -226,6 +226,8 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, | |||
226 | if (!(channels_mask & 1 << i)) | 226 | if (!(channels_mask & 1 << i)) |
227 | continue; | 227 | continue; |
228 | 228 | ||
229 | ret = -EBUSY; | ||
230 | |||
229 | c = cpu_to_be32(1 << (31 - i)); | 231 | c = cpu_to_be32(1 << (31 - i)); |
230 | if ((old & c) != (all & c)) | 232 | if ((old & c) != (all & c)) |
231 | continue; | 233 | continue; |
@@ -251,12 +253,16 @@ static int manage_channel(struct fw_card *card, int irm_id, int generation, | |||
251 | 253 | ||
252 | /* 1394-1995 IRM, fall through to retry. */ | 254 | /* 1394-1995 IRM, fall through to retry. */ |
253 | default: | 255 | default: |
254 | if (retry--) | 256 | if (retry) { |
257 | retry--; | ||
255 | i--; | 258 | i--; |
259 | } else { | ||
260 | ret = -EIO; | ||
261 | } | ||
256 | } | 262 | } |
257 | } | 263 | } |
258 | 264 | ||
259 | return -EIO; | 265 | return ret; |
260 | } | 266 | } |
261 | 267 | ||
262 | static void deallocate_channel(struct fw_card *card, int irm_id, | 268 | static void deallocate_channel(struct fw_card *card, int irm_id, |