Skip to content

Commit aac1e37

Browse files
arndbgregkh
authored andcommitted
drm/amdgpu: fix link error for !PM_SLEEP
[ Upstream commit 4d22db6 ] When power management is not enabled in the kernel build, the newly added hibernation changes cause a link failure: arm-linux-gnueabi-ld: drivers/gpu/drm/amd/amdgpu/amdgpu_drv.o: in function `amdgpu_pmops_thaw': amdgpu_drv.c:(.text+0x1514): undefined reference to `pm_hibernate_is_recovering' Make the power management code in this driver conditional on CONFIG_PM and CONFIG_PM_SLEEP Fixes: 530694f ("drm/amdgpu: do not resume device in thaw for normal hibernation") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 738b014 commit aac1e37

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,15 +2964,15 @@ long amdgpu_drm_ioctl(struct file *filp,
29642964
}
29652965

29662966
static const struct dev_pm_ops amdgpu_pm_ops = {
2967-
.prepare = amdgpu_pmops_prepare,
2968-
.complete = amdgpu_pmops_complete,
2969-
.suspend = amdgpu_pmops_suspend,
2970-
.suspend_noirq = amdgpu_pmops_suspend_noirq,
2971-
.resume = amdgpu_pmops_resume,
2972-
.freeze = amdgpu_pmops_freeze,
2973-
.thaw = amdgpu_pmops_thaw,
2974-
.poweroff = amdgpu_pmops_poweroff,
2975-
.restore = amdgpu_pmops_restore,
2967+
.prepare = pm_sleep_ptr(amdgpu_pmops_prepare),
2968+
.complete = pm_sleep_ptr(amdgpu_pmops_complete),
2969+
.suspend = pm_sleep_ptr(amdgpu_pmops_suspend),
2970+
.suspend_noirq = pm_sleep_ptr(amdgpu_pmops_suspend_noirq),
2971+
.resume = pm_sleep_ptr(amdgpu_pmops_resume),
2972+
.freeze = pm_sleep_ptr(amdgpu_pmops_freeze),
2973+
.thaw = pm_sleep_ptr(amdgpu_pmops_thaw),
2974+
.poweroff = pm_sleep_ptr(amdgpu_pmops_poweroff),
2975+
.restore = pm_sleep_ptr(amdgpu_pmops_restore),
29762976
.runtime_suspend = amdgpu_pmops_runtime_suspend,
29772977
.runtime_resume = amdgpu_pmops_runtime_resume,
29782978
.runtime_idle = amdgpu_pmops_runtime_idle,
@@ -3117,7 +3117,7 @@ static struct pci_driver amdgpu_kms_pci_driver = {
31173117
.probe = amdgpu_pci_probe,
31183118
.remove = amdgpu_pci_remove,
31193119
.shutdown = amdgpu_pci_shutdown,
3120-
.driver.pm = &amdgpu_pm_ops,
3120+
.driver.pm = pm_ptr(&amdgpu_pm_ops),
31213121
.err_handler = &amdgpu_pci_err_handler,
31223122
.dev_groups = amdgpu_sysfs_groups,
31233123
};

0 commit comments

Comments
 (0)