mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +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:
parent
4921561687
commit
dd7633c5f4
8 changed files with 16 additions and 18 deletions
|
@ -8,11 +8,11 @@
|
|||
|
||||
#include <AK/IntrusiveList.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Bus/PCI/Device.h>
|
||||
#include <Kernel/Devices/Audio/Channel.h>
|
||||
#include <Kernel/Devices/Device.h>
|
||||
#include <Kernel/Library/LockRefPtr.h>
|
||||
#include <Kernel/Library/LockWeakable.h>
|
||||
#include <Kernel/Locking/Mutex.h>
|
||||
#include <Kernel/Memory/PhysicalPage.h>
|
||||
|
@ -30,7 +30,7 @@ class AudioController
|
|||
public:
|
||||
virtual ~AudioController() = default;
|
||||
|
||||
virtual LockRefPtr<AudioChannel> audio_channel(u32 index) const = 0;
|
||||
virtual RefPtr<AudioChannel> audio_channel(u32 index) const = 0;
|
||||
virtual ErrorOr<size_t> write(size_t channel_index, UserOrKernelBuffer const& data, size_t length) = 0;
|
||||
|
||||
virtual ErrorOr<void> initialize(Badge<AudioManagement>) = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue