diff options
Diffstat (limited to 'firmware')
-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); |