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

Kernel/VirtIO: Improve error handling during device initialization

Rename the initialize method to initialize_virtio_resources so it's
clear what this method is intended for.

To ensure healthier device initialization, we could also return the type
of ErrorOr<void> from this method, so in all overriden instances and in
the original method code, we could leverage TRY() pattern which also
does simplify the code a bit.
This commit is contained in:
Liav A 2023-04-26 17:01:04 +03:00 committed by Andreas Kling
parent aa985a0570
commit 87a32ab869
8 changed files with 89 additions and 86 deletions

View file

@ -40,7 +40,7 @@ public:
static ErrorOr<bool> probe(PCI::DeviceIdentifier const&);
static ErrorOr<NonnullLockRefPtr<GenericGraphicsAdapter>> create(PCI::DeviceIdentifier const&);
virtual void initialize() override;
virtual ErrorOr<void> initialize_virtio_resources() override;
virtual StringView device_name() const override { return "VirtIOGraphicsAdapter"sv; }