ams: globally prefer R_RETURN to return for ams::Result

This commit is contained in:
Michael Scire
2022-03-26 14:48:33 -07:00
parent dd78ede99f
commit bbf22b4c60
325 changed files with 1955 additions and 1993 deletions

View File

@@ -25,14 +25,10 @@ namespace ams::pwm::driver {
Result OpenSessionImpl(ChannelSession *out, IPwmDevice *device) {
/* Construct the session. */
auto *session = std::construct_at(std::addressof(impl::GetChannelSessionImpl(*out)));
auto session_guard = SCOPE_GUARD { std::destroy_at(session); };
ON_RESULT_FAILURE { std::destroy_at(session); };
/* Open the session. */
R_TRY(session->Open(device, ddsf::AccessMode_ReadWrite));
/* We succeeded. */
session_guard.Cancel();
R_SUCCEED();
R_RETURN(session->Open(device, ddsf::AccessMode_ReadWrite));
}
}