From 41dd8bd22665f92b49df1ac1d27a93aa0294e31c Mon Sep 17 00:00:00 2001 From: TuxSH <1922548+TuxSH@users.noreply.github.com> Date: Sat, 25 May 2024 17:50:22 +0200 Subject: [PATCH] Fix #2034 --- arm9/source/fs.c | 57 ++---------------------------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) diff --git a/arm9/source/fs.c b/arm9/source/fs.c index cb5cac35..5061554a 100644 --- a/arm9/source/fs.c +++ b/arm9/source/fs.c @@ -81,31 +81,10 @@ bool remountCtrNandPartition(bool switchMainDir) static bool nandInitialized = false; int res = FR_OK; -#if 0 - Unfortunately the sdmmc driver is really flaky and returns TMIO_STAT_CMD_RESPEND as error. - (after timing out) - TODO: fix all this tech debt... one day, maybe? - - if (nandInitialized) - { - res = f_unmount("nand:"); - if (res != FR_OK) - { - error("f_unmount returned %d", res); - return false; - } - nandInitialized = false; - } -#endif - if (!nandInitialized) { res = f_mount(&nandFs, "nand:", 1); nandInitialized = res == FR_OK; - if (res != FR_OK) - { - error("f_mount returned %d", res); - } } if (nandInitialized && switchMainDir) @@ -497,30 +476,10 @@ static bool backupEssentialFiles(void) bool doLumaUpgradeProcess(void) { - FirmwareSource oldCtrNandLocation = ctrNandLocation; - bool ok = true, ok2 = true, ok3 = true; + bool ok = true, ok2 = true; -#if 0 - Unfortunately the sdmmc driver is really flaky and returns TMIO_STAT_CMD_RESPEND as error. - (after timing out) - TODO: fix all this tech debt... one day, maybe? - - // Ensure SysNAND CTRNAND is mounted - if (isSdMode) - { - ctrNandLocation = FIRMWARE_SYSNAND; - if (!remountCtrNandPartition(false)) - { - error("failed to mount"); - ctrNandLocation = oldCtrNandLocation; - return false; - } - } -#else - (void)oldCtrNandLocation; // Ensure CTRNAND is mounted remountCtrNandPartition(false); -#endif // Try to boot.firm to CTRNAND, when applicable #ifndef BUILD_FOR_EXPLOIT_DEV @@ -535,17 +494,5 @@ bool doLumaUpgradeProcess(void) fileDelete("sdmc:/luma/config.bin"); fileDelete("nand:/rw/luma/config.bin"); -#if 0 - if (isSdMode) - { - ctrNandLocation = oldCtrNandLocation; - ok3 = remountCtrNandPartition(false); - if (!ok3) - error("failed to unmount"); - } -#else - (void)ok3; -#endif - - return ok && ok2 && ok3; + return ok && ok2; }