summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2011-12-14 18:37:51 +0000
committerRafaël Carré <rafael.carre@gmail.com>2011-12-14 18:37:51 +0000
commitb366d63f035eda1cf7e4882463ea4a521b19fd85 (patch)
tree1e1d071219ba7e96c5c1f120afacadba0280cf07 /firmware/target
parent5b8ed62922fce346dc1c92db264e7ceff8c4796e (diff)
Sansa AMSv2: don't panic if microsd init failed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31254 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index f33dee652a..1df7f33978 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -600,7 +600,7 @@ static void sd_thread(void)
case SYS_HOTSWAP_INSERTED:
case SYS_HOTSWAP_EXTRACTED:
{
- int microsd_init = 1;
+ int changed = 1;
fat_lock(); /* lock-out FAT activity first -
prevent deadlocking via disk_mount that
would cause a reverse-order attempt with
@@ -620,18 +620,14 @@ static void sd_thread(void)
if (ev.id == SYS_HOTSWAP_INSERTED)
{
sd_enable(true);
- microsd_init = sd_init_card(SD_SLOT_AS3525);
- if (microsd_init < 0) /* initialisation failed */
- panicf("microSD init failed : %d", microsd_init);
-
- microsd_init = disk_mount(SD_SLOT_AS3525); /* 0 if fail */
+ changed = (sd_init_card(SD_SLOT_AS3525) == 0) && disk_mount(SD_SLOT_AS3525); /* 0 if fail */
}
/*
* Mount succeeded, or this was an EXTRACTED event,
* in both cases notify the system about the changed filesystems
*/
- if (microsd_init)
+ if (changed)
queue_broadcast(SYS_FS_CHANGED, 0);
sd_enable(false);