diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-04-28 12:02:14 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-04-28 12:02:14 +0000 |
commit | 674b632df847753aaa974fff42f3e74f78043930 (patch) | |
tree | 06bdf3a04c4613f639a8f2a681211ad4ba432f6f /firmware/drivers/ata.c | |
parent | 9d5eab3d9f5d5f9e0cef38c3837b80df67c195ec (diff) | |
download | rockbox-674b632df847753aaa974fff42f3e74f78043930.tar.gz rockbox-674b632df847753aaa974fff42f3e74f78043930.zip |
Corrected wrong write return code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3623 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r-- | firmware/drivers/ata.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 92332b580e..ec99bf799e 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -196,7 +196,6 @@ int ata_read_sectors(unsigned long start, | |||
196 | 196 | ||
197 | timeout = current_tick + READ_TIMEOUT; | 197 | timeout = current_tick + READ_TIMEOUT; |
198 | 198 | ||
199 | retry: | ||
200 | ATA_SELECT = ata_device; | 199 | ATA_SELECT = ata_device; |
201 | if (!wait_for_rdy()) | 200 | if (!wait_for_rdy()) |
202 | { | 201 | { |
@@ -205,6 +204,7 @@ int ata_read_sectors(unsigned long start, | |||
205 | return -2; | 204 | return -2; |
206 | } | 205 | } |
207 | 206 | ||
207 | retry: | ||
208 | buf = inbuf; | 208 | buf = inbuf; |
209 | count = incount; | 209 | count = incount; |
210 | while (TIME_BEFORE(current_tick, timeout)) { | 210 | while (TIME_BEFORE(current_tick, timeout)) { |
@@ -363,10 +363,9 @@ int ata_write_sectors(unsigned long start, | |||
363 | 363 | ||
364 | for (i=0; i<count; i++) { | 364 | for (i=0; i<count; i++) { |
365 | int j; | 365 | int j; |
366 | if (!wait_for_start_of_transfer()) | 366 | if (!wait_for_start_of_transfer()) { |
367 | { | 367 | ret = -3; |
368 | mutex_unlock(&ata_mtx); | 368 | break; |
369 | return 0; | ||
370 | } | 369 | } |
371 | 370 | ||
372 | if (spinup) { | 371 | if (spinup) { |
@@ -391,8 +390,8 @@ int ata_write_sectors(unsigned long start, | |||
391 | last_disk_activity = current_tick; | 390 | last_disk_activity = current_tick; |
392 | } | 391 | } |
393 | 392 | ||
394 | if(!wait_for_end_of_transfer()) | 393 | if(!ret && !wait_for_end_of_transfer()) |
395 | ret = -3; | 394 | ret = -4; |
396 | 395 | ||
397 | led(false); | 396 | led(false); |
398 | 397 | ||