From dd7633c5f418952390d056146510040d08125ee4 Mon Sep 17 00:00:00 2001 From: Liav A Date: Tue, 11 Apr 2023 13:11:02 +0300 Subject: Kernel/Audio: Propagate errors when creating AudioChannels While doing this, we can also just return a normal RefPtr instead of a LockRefPtr, because we create these channels when initializing an audio controller, and never change the pointer in AudioController instances after their initialization, hence no locking is necessary. --- Kernel/Devices/Audio/Channel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Kernel/Devices/Audio/Channel.h') diff --git a/Kernel/Devices/Audio/Channel.h b/Kernel/Devices/Audio/Channel.h index 7106bd9ae2..188264a8de 100644 --- a/Kernel/Devices/Audio/Channel.h +++ b/Kernel/Devices/Audio/Channel.h @@ -20,7 +20,7 @@ class AudioChannel final friend class DeviceManagement; public: - static NonnullLockRefPtr must_create(AudioController const&, size_t channel_index); + static ErrorOr> create(AudioController const&, size_t channel_index); virtual ~AudioChannel() override = default; // ^CharacterDevice -- cgit v1.2.3