ams: use R_SUCCEED, R_THROW globally
This commit is contained in:
@@ -138,7 +138,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
||||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void I2cBusAccessor::FinalizeDevice(I2cDeviceProperty *device) {
|
||||
@@ -320,7 +320,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
||||
|
||||
/* We opened (or not). */
|
||||
s_guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void I2cBusAccessor::ExecuteInitialConfig() {
|
||||
@@ -438,7 +438,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
||||
|
||||
/* We're done. */
|
||||
this->DisableInterruptMask();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result I2cBusAccessor::Receive(u8 *dst, size_t dst_size, TransactionOption option, u16 slave_address, AddressingMode addressing_mode) {
|
||||
@@ -504,7 +504,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
||||
}
|
||||
|
||||
/* We're done. */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void I2cBusAccessor::WriteHeader(Xfer xfer, size_t size, TransactionOption option, u16 slave_address, AddressingMode addressing_mode) {
|
||||
@@ -728,7 +728,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
||||
os::SleepThread(TimeSpan::FromMilliSeconds(1));
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result I2cBusAccessor::GetTransactionResult() const {
|
||||
@@ -749,7 +749,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
||||
R_UNLESS(reg::HasValue(interrupt_status, I2C_REG_BITS_ENUM(INTERRUPT_STATUS_REGISTER_ARB_LOST, UNSET)), i2c::ResultBusBusy());
|
||||
|
||||
clear_guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void I2cBusAccessor::HandleTransactionError(Result result) {
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace ams::i2c::driver::board::nintendo::nx::impl {
|
||||
return result;
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
public:
|
||||
virtual void InitializeDriver() override;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace ams::i2c::driver {
|
||||
|
||||
/* We succeeded. */
|
||||
session_guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,7 +50,7 @@ namespace ams::i2c::driver {
|
||||
/* Open the session. */
|
||||
R_TRY(OpenSessionImpl(out, device));
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void CloseSession(I2cSession &session) {
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace ams::i2c::driver::impl {
|
||||
Result RegisterDeviceCode(DeviceCode device_code, I2cDeviceProperty *device) {
|
||||
AMS_ASSERT(device != nullptr);
|
||||
R_TRY(GetDeviceCodeEntryManager().Add(device_code, device));
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
bool UnregisterDeviceCode(DeviceCode device_code) {
|
||||
@@ -96,7 +96,7 @@ namespace ams::i2c::driver::impl {
|
||||
|
||||
/* Set output. */
|
||||
*out = device->SafeCastToPointer<I2cDeviceProperty>();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result FindDeviceByBusIndexAndAddress(I2cDeviceProperty **out, i2c::I2cBus bus_index, u16 slave_address) {
|
||||
@@ -125,7 +125,7 @@ namespace ams::i2c::driver::impl {
|
||||
/* Check that we found the pad. */
|
||||
R_UNLESS(found, ddsf::ResultDeviceCodeNotFound());
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace ams::i2c::driver::impl {
|
||||
|
||||
/* We're opened. */
|
||||
guard.Cancel();
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void I2cSessionImpl::Close() {
|
||||
@@ -83,7 +83,7 @@ namespace ams::i2c::driver::impl {
|
||||
/* Advance. */
|
||||
*cur_cmd += size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result I2cSessionImpl::ReceiveHandler(const u8 **cur_cmd, u8 **cur_dst) {
|
||||
@@ -102,7 +102,7 @@ namespace ams::i2c::driver::impl {
|
||||
/* Advance. */
|
||||
*cur_dst += size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result I2cSessionImpl::ExtensionHandler(const u8 **cur_cmd, u8 **cur_dst) {
|
||||
@@ -123,7 +123,7 @@ namespace ams::i2c::driver::impl {
|
||||
AMS_UNREACHABLE_DEFAULT_CASE();
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result I2cSessionImpl::ExecuteTransactionWithRetry(void *dst, Command command, const void *src, size_t size, TransactionOption option) {
|
||||
@@ -152,7 +152,7 @@ namespace ams::i2c::driver::impl {
|
||||
}
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,13 +193,13 @@ namespace ams::i2c::driver::impl {
|
||||
}
|
||||
}
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result I2cSessionImpl::SetRetryPolicy(int mr, int interval_us) {
|
||||
m_max_retry_count = mr;
|
||||
m_retry_interval = TimeSpan::FromMicroSeconds(interval_us);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace ams::i2c {
|
||||
out->_session = session.Detach();
|
||||
|
||||
/* We succeeded. */
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
void CloseSession(I2cSession &session) {
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace ams::i2c {
|
||||
|
||||
Result CommandListFormatter::IsEnqueueAble(size_t sz) const {
|
||||
R_UNLESS(m_command_list_length - m_current_index >= sz, i2c::ResultCommandListFull());
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CommandListFormatter::EnqueueReceiveCommand(i2c::TransactionOption option, size_t size) {
|
||||
@@ -44,7 +44,7 @@ namespace ams::i2c {
|
||||
header1 = {};
|
||||
header1.Set<impl::ReceiveCommandFormat::Size>(size);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CommandListFormatter::EnqueueSendCommand(i2c::TransactionOption option, const void *src, size_t size) {
|
||||
@@ -72,7 +72,7 @@ namespace ams::i2c {
|
||||
std::memcpy(cmd_list + m_current_index, src, size);
|
||||
m_current_index += size;
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
Result CommandListFormatter::EnqueueSleepCommand(int us) {
|
||||
@@ -95,7 +95,7 @@ namespace ams::i2c {
|
||||
header1 = {};
|
||||
header1.Set<impl::SleepCommandFormat::MicroSeconds>(us);
|
||||
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace ams::i2c::server {
|
||||
|
||||
/* We succeeded. */
|
||||
*out = std::move(session);
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace ams::i2c::server {
|
||||
|
||||
R_TRY(i2c::driver::OpenSession(std::addressof(m_internal_session), device_code));
|
||||
m_has_session = true;
|
||||
return ResultSuccess();
|
||||
R_SUCCEED();
|
||||
}
|
||||
public:
|
||||
/* Actual commands. */
|
||||
|
||||
Reference in New Issue
Block a user