boot: refactor for R_TRY

This commit is contained in:
Michael Scire
2019-06-20 00:57:17 -07:00
parent 491383c637
commit 7b6050a0cb
16 changed files with 223 additions and 623 deletions

View File

@@ -33,11 +33,7 @@ void PmicDriver::RebootSystem() {
Result PmicDriver::GetAcOk(bool *out) {
u8 power_status;
Result rc = this->GetPowerStatus(&power_status);
if (R_FAILED(rc)) {
return rc;
}
R_TRY(this->GetPowerStatus(&power_status));
*out = (power_status & 0x02) != 0;
return ResultSuccess;
}
@@ -59,10 +55,7 @@ Result PmicDriver::GetNvErc(u8 *out) {
Result PmicDriver::GetPowerButtonPressed(bool *out) {
u8 power_intr;
Result rc = this->GetPowerIntr(&power_intr);
if (R_FAILED(rc)) {
return rc;
}
R_TRY(this->GetPowerIntr(&power_intr));
*out = (power_intr & 0x08) != 0;
return ResultSuccess;
}