From 11d32ec78f37b87a0ee646a492b84a3ed2f5ee1a Mon Sep 17 00:00:00 2001 From: Christoph Baumann Date: Thu, 22 May 2025 12:22:32 +0200 Subject: [PATCH] Only deinit if necessary --- fusee/program/source/fusee_boot_storage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fusee/program/source/fusee_boot_storage.cpp b/fusee/program/source/fusee_boot_storage.cpp index ccd98d2f3..a3387bab8 100644 --- a/fusee/program/source/fusee_boot_storage.cpp +++ b/fusee/program/source/fusee_boot_storage.cpp @@ -2,6 +2,7 @@ #include "fs/fusee_fs_api.hpp" #include "fusee_mmc.hpp" #include "fusee_sd_card.hpp" +#include "fusee_util.hpp" #include namespace ams::nxboot { @@ -27,9 +28,8 @@ namespace ams::nxboot { case BootDrive_Boot1Off: { R_TRY(InitializeMmc()); - ON_RESULT_FAILURE { FinalizeMmc(); }; R_UNLESS(fs::MountBoot1Off(), fs::ResultInvalidMountName()); - ON_RESULT_FAILURE_2 { fs::UnmountBoot1Off(); }; + ON_RESULT_FAILURE { fs::UnmountBoot1Off(); }; R_TRY(fs::ChangeDrive("boot1_off:")); R_TRY(IsBootStorageValid()); g_boot_storage = storage; @@ -38,9 +38,8 @@ namespace ams::nxboot { case BootDrive_Boot1: { R_TRY(InitializeMmc()); - ON_RESULT_FAILURE { FinalizeMmc(); }; R_UNLESS(fs::MountBoot1(), fs::ResultInvalidMountName()); - ON_RESULT_FAILURE_2 { fs::UnmountBoot1(); }; + ON_RESULT_FAILURE { fs::UnmountBoot1(); }; R_TRY(fs::ChangeDrive("boot1:")); R_TRY(IsBootStorageValid()); g_boot_storage = storage; @@ -49,6 +48,7 @@ namespace ams::nxboot { case BootDrive_System: { R_TRY(InitializeMmc()); + /* Only finalize mmc now, next drive to try is SD card */ ON_RESULT_FAILURE { FinalizeMmc(); }; R_UNLESS(fs::MountSys(), fs::ResultInvalidMountName()); ON_RESULT_FAILURE_2 { fs::UnmountSys(); };