Skip to content

Add the pci_get_base_class() helper and use it

Sui Jingfeng alsa-devel amd-gfx dri-devel linux-pci lkml nouveau 1 version Applied

Status from this message: Applied to pci/enumeration for v6.7, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5PCI: Add the pci_get_base_class() helperdrivers/pci/search.c include/linux/pci.h+36 -00 replies
2/5ALSA: hda/intel: Use pci_get_base_class() to reduce duplicated codesound/pci/hda/hda_intel.c+5 -111 reply
3/5drm/nouveau: Use pci_get_base_class() to reduce duplicated codedrivers/gpu/drm/nouveau/nouveau_acpi.c+4 -70 replies
4/5drm/amdgpu: Use pci_get_base_class() to reduce duplicated codedrivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c+9 -220 replies
5/5drm/radeon: Use pci_get_base_class() to reduce duplicated codedrivers/gpu/drm/radeon/radeon_bios.c+5 -150 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchTakashi IwaiAlex Deucher
SeriesR-b
1/5
2/5R-b
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] Add the pci_get_base_class() helper and use it

From: Sui Jingfeng <[email protected]>

There is no function that can be used to get all PCI(e) devices in a system by matching against its the PCI base class code only, while keep the sub-class code and the programming interface ignored. Therefore, add the pci_get_base_class() function to suit the need.

For example, if an application want to process all PCI(e) display devices in a system, it can achieve such goal by writing the code as following:

    pdev = NULL;
    do {
        pdev = pci_get_base_class(PCI_BASE_CLASS_DISPLAY, pdev);
        if (!pdev)
            break;

        do_something_for_pci_display_device(pdev);
    } while (1);

Sui Jingfeng (5):
PCI: Add the pci_get_base_class() helper
ALSA: hda/intel: Use pci_get_base_class() to reduce duplicated code drm/nouveau: Use pci_get_base_class() to reduce duplicated code drm/amdgpu: Use pci_get_base_class() to reduce duplicated code drm/radeon: Use pci_get_base_class() to reduce duplicated code

 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 11 +++------
 drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 20 ++++-----------
 drivers/gpu/drm/nouveau/nouveau_acpi.c   | 11 +++------
 drivers/gpu/drm/radeon/radeon_bios.c     | 20 ++++-----------
 drivers/pci/search.c                     | 31 ++++++++++++++++++++++++
 include/linux/pci.h                      |  5 ++++
 sound/pci/hda/hda_intel.c                | 16 ++++--------
 7 files changed, 59 insertions(+), 55 deletions(-)
Signature · 1 line
2.34.1