summaryrefslogtreecommitdiff
path: root/Kernel/Bus/USB/UHCIController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Bus/USB/UHCIController.cpp')
-rw-r--r--Kernel/Bus/USB/UHCIController.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/Kernel/Bus/USB/UHCIController.cpp b/Kernel/Bus/USB/UHCIController.cpp
index 3a6c52d95b..7d36c3ae58 100644
--- a/Kernel/Bus/USB/UHCIController.cpp
+++ b/Kernel/Bus/USB/UHCIController.cpp
@@ -591,16 +591,8 @@ KResultOr<size_t> UHCIController::submit_control_transfer(Transfer& transfer)
TransferDescriptor* last_data_descriptor;
TransferDescriptor* data_descriptor_chain;
auto buffer_address = Ptr32<u8>(transfer.buffer_physical().as_ptr() + sizeof(USBRequestData));
- auto transfer_chain_create_result = create_chain(pipe,
- direction_in ? PacketID::IN : PacketID::OUT,
- buffer_address,
- pipe.max_packet_size(),
- transfer.transfer_data_size(),
- &data_descriptor_chain,
- &last_data_descriptor);
-
- if (transfer_chain_create_result != KSuccess)
- return transfer_chain_create_result;
+ if (auto result = create_chain(pipe, direction_in ? PacketID::IN : PacketID::OUT, buffer_address, pipe.max_packet_size(), transfer.transfer_data_size(), &data_descriptor_chain, &last_data_descriptor); result.is_error())
+ return result;
// Status TD always has toggle set to 1
pipe.set_toggle(true);