1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:27:35 +00:00

Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T>

We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace!
This was a slightly tedious refactoring that took a long time, so it's
not unlikely that some bugs crept in.

Nevertheless, it does pass basic functionality testing, and it's just
real nice to finally see the same pattern in all contexts. :^)
This commit is contained in:
Andreas Kling 2021-11-08 00:51:39 +01:00
parent 7ee10c6926
commit 79fa9765ca
262 changed files with 2415 additions and 2600 deletions

View file

@ -80,18 +80,18 @@ static constexpr u16 PORT_STATUS_RESET_CHANGED = (1 << 4);
class Hub : public Device {
public:
static KResultOr<NonnullRefPtr<Hub>> try_create_root_hub(NonnullRefPtr<USBController>, DeviceSpeed);
static KResultOr<NonnullRefPtr<Hub>> try_create_from_device(Device const&);
static ErrorOr<NonnullRefPtr<Hub>> try_create_root_hub(NonnullRefPtr<USBController>, DeviceSpeed);
static ErrorOr<NonnullRefPtr<Hub>> try_create_from_device(Device const&);
virtual ~Hub() override = default;
KResult enumerate_and_power_on_hub();
ErrorOr<void> enumerate_and_power_on_hub();
KResult get_port_status(u8, HubStatus&);
KResult clear_port_feature(u8, HubFeatureSelector);
KResult set_port_feature(u8, HubFeatureSelector);
ErrorOr<void> get_port_status(u8, HubStatus&);
ErrorOr<void> clear_port_feature(u8, HubFeatureSelector);
ErrorOr<void> set_port_feature(u8, HubFeatureSelector);
KResult reset_port(u8);
ErrorOr<void> reset_port(u8);
void check_for_port_updates();