1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

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.
This commit is contained in:
Liav A 2023-04-11 13:11:02 +03:00 committed by Linus Groh
parent 4921561687
commit dd7633c5f4
8 changed files with 16 additions and 18 deletions

View file

@ -92,7 +92,7 @@ UNMAP_AFTER_INIT ErrorOr<void> Controller::initialize(Badge<AudioManagement>)
return result.release_error();
}
m_audio_channel = AudioChannel::must_create(*this, fixed_audio_channel_index);
m_audio_channel = TRY(AudioChannel::create(*this, fixed_audio_channel_index));
return {};
}
@ -290,7 +290,7 @@ ErrorOr<void> Controller::reset()
return {};
}
LockRefPtr<AudioChannel> Controller::audio_channel(u32 index) const
RefPtr<AudioChannel> Controller::audio_channel(u32 index) const
{
if (index != fixed_audio_channel_index)
return {};