drm/amdgpu: simplify ATPX detection
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Oct 2019 19:39:37 +0000 (14:39 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Oct 2019 19:51:39 +0000 (15:51 -0400)
Use the base class rather than the specific class and drop
the second loop.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c

index 3e35a8f2c5e553e4c714deff5e838ac1510a2f59..a97fb759e2f42a94b004743219881f47e79a20ee 100644 (file)
@@ -613,17 +613,7 @@ static bool amdgpu_atpx_detect(void)
        bool d3_supported = false;
        struct pci_dev *parent_pdev;
 
-       while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
-               vga_count++;
-
-               has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
-
-               parent_pdev = pci_upstream_bridge(pdev);
-               d3_supported |= parent_pdev && parent_pdev->bridge_d3;
-               amdgpu_atpx_get_quirks(pdev);
-       }
-
-       while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
+       while ((pdev = pci_get_class(PCI_BASE_CLASS_DISPLAY << 16, pdev)) != NULL) {
                vga_count++;
 
                has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);