@@ -38,21 +38,23 @@ UNMAP_AFTER_INIT AudioManagement::AudioManagement()
38
38
39
39
UNMAP_AFTER_INIT void AudioManagement::enumerate_hardware_controllers ()
40
40
{
41
- PCI::enumerate ([&](PCI::DeviceIdentifier const & device_identifier) {
42
- // Note: Only consider PCI audio controllers
43
- if (device_identifier.class_code ().value () != to_underlying (PCI::ClassID::Multimedia)
44
- || device_identifier.subclass_code ().value () != to_underlying (PCI::Multimedia::SubclassID::AudioController))
45
- return ;
41
+ if (!PCI::Access::is_disabled ()) {
42
+ PCI::enumerate ([&](PCI::DeviceIdentifier const & device_identifier) {
43
+ // Note: Only consider PCI audio controllers
44
+ if (device_identifier.class_code ().value () != to_underlying (PCI::ClassID::Multimedia)
45
+ || device_identifier.subclass_code ().value () != to_underlying (PCI::Multimedia::SubclassID::AudioController))
46
+ return ;
46
47
47
- dbgln (" AC97: found audio controller at {}" , device_identifier.address ());
48
- auto ac97_device = AC97::try_create (device_identifier);
49
- if (ac97_device.is_error ()) {
50
- // FIXME: Propagate errors properly
51
- dbgln (" AudioManagement: failed to initialize AC97 device: {}" , ac97_device.error ());
52
- return ;
53
- }
54
- m_controllers_list.append (ac97_device.release_value ());
55
- });
48
+ dbgln (" AC97: found audio controller at {}" , device_identifier.address ());
49
+ auto ac97_device = AC97::try_create (device_identifier);
50
+ if (ac97_device.is_error ()) {
51
+ // FIXME: Propagate errors properly
52
+ dbgln (" AudioManagement: failed to initialize AC97 device: {}" , ac97_device.error ());
53
+ return ;
54
+ }
55
+ m_controllers_list.append (ac97_device.release_value ());
56
+ });
57
+ }
56
58
}
57
59
58
60
UNMAP_AFTER_INIT void AudioManagement::enumerate_hardware_audio_channels ()
0 commit comments