From b366d63f035eda1cf7e4882463ea4a521b19fd85 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Wed, 14 Dec 2011 18:37:51 +0000 Subject: Sansa AMSv2: don't panic if microsd init failed git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31254 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/sd-as3525v2.c | 10 +++------- 1 file 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); -- cgit v1.2.3