diff options
| author | Sui Jingfeng <[email protected]> | 2023-08-25 06:27:10 +0000 |
|---|---|---|
| committer | Bjorn Helgaas <[email protected]> | 2023-09-28 21:49:44 +0000 |
| commit | d427da2323b093a65d8317783e76ab8fad2e2ef0 (patch) | |
| tree | 9a4e09282f1b8585a212fa58e3013b26de7ca452 /drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | |
| parent | Linux 6.6-rc1 (diff) | |
| download | kernel-d427da2323b093a65d8317783e76ab8fad2e2ef0.tar.gz kernel-d427da2323b093a65d8317783e76ab8fad2e2ef0.zip | |
PCI: Add pci_get_base_class() helper
There is no function to get all PCI devices in a system by matching
against the base class code only, ignoring the sub-class code and
the programming interface. Add pci_get_base_class() to suit the
need.
For example, if a driver wants to process all PCI display devices in
a system, it can do so like this:
pdev = NULL;
while ((pdev = pci_get_base_class(PCI_BASE_CLASS_DISPLAY, pdev))) {
do_something_for_pci_display_device(pdev);
}
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sui Jingfeng <[email protected]>
[bhelgaas: reword commit log]
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c')
0 files changed, 0 insertions, 0 deletions
