drm/amdgpu: simplify logic in atpx resume handling
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Dec 2020 18:21:36 +0000 (13:21 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Dec 2020 16:35:21 +0000 (11:35 -0500)
Simplify the logic in the runtime resume handling for
atpx

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

index 4f97d493eedac9e5567086e9feb4465f1207baaf..cac2724e7615a4a37360c6854ae3988ce0a8161b 100644 (file)
@@ -1382,16 +1382,14 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
                /* Only need to handle PCI state in the driver for ATPX
                 * PCI core handles it for _PR3.
                 */
-               if (amdgpu_is_atpx_hybrid()) {
-                       pci_set_master(pdev);
-               } else {
+               if (!amdgpu_is_atpx_hybrid()) {
                        pci_set_power_state(pdev, PCI_D0);
                        amdgpu_device_load_pci_state(pdev);
                        ret = pci_enable_device(pdev);
                        if (ret)
                                return ret;
-                       pci_set_master(pdev);
                }
+               pci_set_master(pdev);
        } else if (amdgpu_device_supports_boco(drm_dev)) {
                /* Only need to handle PCI state in the driver for ATPX
                 * PCI core handles it for _PR3.