Blob Blame History Raw
From 2978891aff80e8dcae85f078213048a4bcd0ec2b Mon Sep 17 00:00:00 2001
From: Mario Limonciello <mario.limonciello@amd.com>
Date: Tue, 26 Oct 2021 12:14:41 -0500
Subject: [PATCH] platform/x86: amd-pmc: fix compilation without CONFIG_RTC_SYSTOHC_DEVICE
Git-commit: 2978891aff80e8dcae85f078213048a4bcd0ec2b
Patch-mainline: v5.16-rc1
References: bsc#1210644

Just hardcode the RTC to "rtc0" which is the default for
CONFIG_RTC_SYSTOHC_DEVICE and used by all standard x86 distros.

Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Suggested-by: Hans de Goede <hdegoede@redhat.com>
Fixes: 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20211026171443.289-1-mario.limonciello@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/platform/x86/amd-pmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
index 678bf6874c63..b8d77a18e95a 100644
--- a/drivers/platform/x86/amd-pmc.c
+++ b/drivers/platform/x86/amd-pmc.c
@@ -425,7 +425,7 @@ static int amd_pmc_verify_czn_rtc(struct amd_pmc_dev *pdev, u32 *arg)
 	if (pdev->major < 64 || (pdev->major == 64 && pdev->minor < 53))
 		return 0;
 
-	rtc_device = rtc_class_open(CONFIG_RTC_SYSTOHC_DEVICE);
+	rtc_device = rtc_class_open("rtc0");
 	if (!rtc_device)
 		return 0;
 	rc = rtc_read_alarm(rtc_device, &alarm);
-- 
2.35.3