1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:17:44 +00:00

Kernel/Devices: Use try_create_device helper for SB16

This commit is contained in:
Liav A 2021-09-16 22:24:55 +03:00 committed by Idan Horowitz
parent fd4397a430
commit 44f5f72add
5 changed files with 26 additions and 22 deletions

View file

@ -18,13 +18,12 @@ class SB16;
class SB16 final : public IRQHandler
, public CharacterDevice {
friend class DeviceManagement;
public:
SB16();
virtual ~SB16() override;
static void detect();
static void create();
static SB16& the();
static RefPtr<SB16> try_detect_and_create();
// ^CharacterDevice
virtual bool can_read(const OpenFileDescription&, size_t) const override;
@ -37,6 +36,8 @@ public:
virtual KResult ioctl(OpenFileDescription&, unsigned, Userspace<void*>) override;
private:
SB16();
// ^IRQHandler
virtual bool handle_irq(const RegisterState&) override;