From ee2e9d50fd93721b365daf0eae1eef17c8ba62e8 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 2 Feb 2021 18:32:29 -0800 Subject: [PATCH] hid: fix sm usage --- libraries/libstratosphere/source/hid/hid_api.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/libstratosphere/source/hid/hid_api.cpp b/libraries/libstratosphere/source/hid/hid_api.cpp index ece8133f2..ba07cde57 100644 --- a/libraries/libstratosphere/source/hid/hid_api.cpp +++ b/libraries/libstratosphere/source/hid/hid_api.cpp @@ -40,14 +40,12 @@ namespace ams::hid { /* Helper. */ void InitializeHid() { - R_ABORT_UNLESS(smInitialize()); - ON_SCOPE_EXIT { smExit(); }; - { + sm::DoWithSession([&]() { R_ABORT_UNLESS(hidInitialize()); hidInitializeNpad(); R_ABORT_UNLESS(hidSetSupportedNpadIdType(NpadIdTypes, NumNpadIdTypes)); R_ABORT_UNLESS(hidSetSupportedNpadStyleSet(HidNpadStyleSet_NpadStandard | HidNpadStyleTag_NpadSystemExt)); - } + }); } Result EnsureHidInitialized() {