summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-07-11 13:46:10 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-07-11 13:46:10 +0000
commit75fa6998148d3b33b6672946fcfa90072f33c53d (patch)
tree21ee0ec96be23f0c028476639b773c9006e5a36a /firmware/target/arm
parent306753b1ed328bcb3cf999a199580031f3d29603 (diff)
downloadrockbox-75fa6998148d3b33b6672946fcfa90072f33c53d.tar.gz
rockbox-75fa6998148d3b33b6672946fcfa90072f33c53d.tar.bz2
rockbox-75fa6998148d3b33b6672946fcfa90072f33c53d.zip
Sansa AMS: handle properly SD transfer errors
clocks disabling and mutex unlocking were not made in case of errors git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21773 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 470efa56ab..ae3d466abf 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -753,17 +753,21 @@ static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start,
}
}
+ ret = 0; /* success */
+
+sd_transfer_error:
+
dma_release();
#ifndef BOOTLOADER
led(false);
sd_enable(false);
#endif
- mutex_unlock(&sd_mtx);
- return 0;
-sd_transfer_error:
- card_info[drive].initialized = 0;
+ if (ret) /* error */
+ card_info[drive].initialized = 0;
+
+ mutex_unlock(&sd_mtx);
return ret;
}