diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2011-12-14 18:37:51 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2011-12-14 18:37:51 +0000 |
commit | b366d63f035eda1cf7e4882463ea4a521b19fd85 (patch) | |
tree | 1e1d071219ba7e96c5c1f120afacadba0280cf07 | |
parent | 5b8ed62922fce346dc1c92db264e7ceff8c4796e (diff) | |
download | rockbox-b366d63f035eda1cf7e4882463ea4a521b19fd85.tar.gz rockbox-b366d63f035eda1cf7e4882463ea4a521b19fd85.zip |
Sansa AMSv2: don't panic if microsd init failed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31254 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525v2.c | 10 |
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) | |||
600 | case SYS_HOTSWAP_INSERTED: | 600 | case SYS_HOTSWAP_INSERTED: |
601 | case SYS_HOTSWAP_EXTRACTED: | 601 | case SYS_HOTSWAP_EXTRACTED: |
602 | { | 602 | { |
603 | int microsd_init = 1; | 603 | int changed = 1; |
604 | fat_lock(); /* lock-out FAT activity first - | 604 | fat_lock(); /* lock-out FAT activity first - |
605 | prevent deadlocking via disk_mount that | 605 | prevent deadlocking via disk_mount that |
606 | would cause a reverse-order attempt with | 606 | would cause a reverse-order attempt with |
@@ -620,18 +620,14 @@ static void sd_thread(void) | |||
620 | if (ev.id == SYS_HOTSWAP_INSERTED) | 620 | if (ev.id == SYS_HOTSWAP_INSERTED) |
621 | { | 621 | { |
622 | sd_enable(true); | 622 | sd_enable(true); |
623 | microsd_init = sd_init_card(SD_SLOT_AS3525); | 623 | changed = (sd_init_card(SD_SLOT_AS3525) == 0) && disk_mount(SD_SLOT_AS3525); /* 0 if fail */ |
624 | if (microsd_init < 0) /* initialisation failed */ | ||
625 | panicf("microSD init failed : %d", microsd_init); | ||
626 | |||
627 | microsd_init = disk_mount(SD_SLOT_AS3525); /* 0 if fail */ | ||
628 | } | 624 | } |
629 | 625 | ||
630 | /* | 626 | /* |
631 | * Mount succeeded, or this was an EXTRACTED event, | 627 | * Mount succeeded, or this was an EXTRACTED event, |
632 | * in both cases notify the system about the changed filesystems | 628 | * in both cases notify the system about the changed filesystems |
633 | */ | 629 | */ |
634 | if (microsd_init) | 630 | if (changed) |
635 | queue_broadcast(SYS_FS_CHANGED, 0); | 631 | queue_broadcast(SYS_FS_CHANGED, 0); |
636 | 632 | ||
637 | sd_enable(false); | 633 | sd_enable(false); |