1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 13:37:45 +00:00

Kernel: Make PCI [Sub]ClassCode comparable to the corresponding ID enums

This commit is contained in:
Hendiadyoin1 2023-09-11 16:01:01 +02:00 committed by Andrew Kaster
parent 3273ef1e3f
commit 66647b58d4
5 changed files with 15 additions and 8 deletions

View file

@ -34,8 +34,8 @@ UNMAP_AFTER_INIT ErrorOr<NonnullRefPtr<AudioController>> AC97::create(PCI::Devic
UNMAP_AFTER_INIT ErrorOr<bool> AC97::probe(PCI::DeviceIdentifier const& device_identifier)
{
VERIFY(device_identifier.class_code().value() == to_underlying(PCI::ClassID::Multimedia));
return device_identifier.subclass_code().value() == to_underlying(PCI::Multimedia::SubclassID::AudioController);
VERIFY(device_identifier.class_code() == PCI::ClassID::Multimedia);
return device_identifier.subclass_code() == PCI::Multimedia::SubclassID::AudioController;
}
UNMAP_AFTER_INIT AC97::AC97(PCI::DeviceIdentifier const& pci_device_identifier, NonnullOwnPtr<AC97Channel> pcm_out_channel, NonnullOwnPtr<IOWindow> mixer_io_window, NonnullOwnPtr<IOWindow> bus_io_window)

View file

@ -19,8 +19,8 @@ namespace Kernel::Audio::IntelHDA {
UNMAP_AFTER_INIT ErrorOr<bool> Controller::probe(PCI::DeviceIdentifier const& device_identifier)
{
VERIFY(device_identifier.class_code().value() == to_underlying(PCI::ClassID::Multimedia));
return device_identifier.subclass_code().value() == to_underlying(PCI::Multimedia::SubclassID::HDACompatibleController);
VERIFY(device_identifier.class_code() == PCI::ClassID::Multimedia);
return device_identifier.subclass_code() == PCI::Multimedia::SubclassID::HDACompatibleController;
}
UNMAP_AFTER_INIT ErrorOr<NonnullRefPtr<AudioController>> Controller::create(PCI::DeviceIdentifier const& pci_device_identifier)

View file

@ -71,7 +71,7 @@ UNMAP_AFTER_INIT void AudioManagement::enumerate_hardware_controllers()
return;
MUST(PCI::enumerate([&](PCI::DeviceIdentifier const& device_identifier) {
// Only consider PCI multimedia devices
if (device_identifier.class_code().value() != to_underlying(PCI::ClassID::Multimedia))
if (device_identifier.class_code() != PCI::ClassID::Multimedia)
return;
auto result = determine_audio_device(device_identifier);