Kernel: Use PCIDeviceIdentifier is_msi_capable() to retrieve MSI status

Instead of iterating through the capabilities, use the is_msi_capable()
API from the PCIDeviceIdentifier class that belongs to the device.
This commit is contained in:
Pankaj Raghav 2023-05-08 21:26:55 +02:00 committed by Jelle Raaijmakers
parent 09b5cefd43
commit 1bc2c5c110

View file

@ -23,9 +23,7 @@ Device::Device(DeviceIdentifier const& pci_identifier)
bool Device::is_msi_capable() const
{
return AK::any_of(
m_pci_identifier->capabilities(),
[](auto const& capability) { return capability.id().value() == PCI::Capabilities::ID::MSI; });
return m_pci_identifier->is_msi_capable();
}
bool Device::is_msix_capable() const
{