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 | |
parent | 9d5eab3d9f5d5f9e0cef38c3837b80df67c195ec (diff) |
Corrected wrong write return code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3623 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-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, timeout = current_tick + READ_TIMEOUT; - retry: ATA_SELECT = ata_device; if (!wait_for_rdy()) { @@ -205,6 +204,7 @@ int ata_read_sectors(unsigned long start, return -2; } + retry: buf = inbuf; count = incount; while (TIME_BEFORE(current_tick, timeout)) { @@ -363,10 +363,9 @@ int ata_write_sectors(unsigned long start, for (i=0; i<count; i++) { int j; - if (!wait_for_start_of_transfer()) - { - mutex_unlock(&ata_mtx); - return 0; + if (!wait_for_start_of_transfer()) { + ret = -3; + break; } if (spinup) { @@ -391,8 +390,8 @@ int ata_write_sectors(unsigned long start, last_disk_activity = current_tick; } - if(!wait_for_end_of_transfer()) - ret = -3; + if(!ret && !wait_for_end_of_transfer()) + ret = -4; led(false); |