linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marek Maslanka <mmaslanka@google.com>
To: lkp@intel.com
Cc: daniel.lezcano@linaro.org, hdegoede@redhat.com,
	linux-mm@kvack.org,  mmaslanka@google.com,
	oe-kbuild-all@lists.linux.dev
Subject: [PATCH] platform/x86:intel/pmc: Encapsulate callbacks registration in CONFIG_X86_PM_TIMER check
Date: Sun,  8 Sep 2024 20:01:27 +0000	[thread overview]
Message-ID: <20240908200127.1848844-1-mmaslanka@google.com> (raw)
In-Reply-To: <202409090259.6vsS5Bni-lkp@intel.com>

Encapsulate the code that registers and unregisters the ACPI PM Timer
suspend/resume callback to checks that CONFIG_X86_PM_TIMER is enabled.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409090259.6vsS5Bni-lkp@intel.com/
Signed-off-by: Marek Maslanka <mmaslanka@google.com>
---
 drivers/platform/x86/intel/pmc/core.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index 695804ca8de4..0c6392eeacee 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -1215,6 +1215,7 @@ static bool pmc_core_is_pson_residency_enabled(struct pmc_dev *pmcdev)
 	return val == 1;
 }
 
+#ifdef CONFIG_X86_PM_TIMER
 /*
  * Enable or disable ACPI PM Timer
  *
@@ -1247,6 +1248,7 @@ static void pmc_core_acpi_pm_timer_suspend_resume(void *data, bool suspend)
 
 	pmcdev->enable_acpi_pm_timer_on_resume = suspend && enabled;
 }
+#endif
 
 static void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev)
 {
@@ -1443,9 +1445,11 @@ static int pmc_core_probe(struct platform_device *pdev)
 	struct pmc_dev *pmcdev;
 	const struct x86_cpu_id *cpu_id;
 	int (*core_init)(struct pmc_dev *pmcdev);
-	const struct pmc_reg_map *map;
 	struct pmc *primary_pmc;
 	int ret;
+#ifdef CONFIG_X86_PM_TIMER
+	const struct pmc_reg_map *map;
+#endif
 
 	if (device_initialized)
 		return -ENODEV;
@@ -1502,10 +1506,12 @@ static int pmc_core_probe(struct platform_device *pdev)
 	pm_report_max_hw_sleep(FIELD_MAX(SLP_S0_RES_COUNTER_MASK) *
 			       pmc_core_adjust_slp_s0_step(primary_pmc, 1));
 
+#ifdef CONFIG_X86_PM_TIMER
 	map = primary_pmc->map;
 	if (map->acpi_pm_tmr_ctl_offset)
 		acpi_pmtmr_register_suspend_resume_callback(pmc_core_acpi_pm_timer_suspend_resume,
-							 pmcdev);
+							    pmcdev);
+#endif
 
 	device_initialized = true;
 	dev_info(&pdev->dev, " initialized\n");
@@ -1516,11 +1522,13 @@ static int pmc_core_probe(struct platform_device *pdev)
 static void pmc_core_remove(struct platform_device *pdev)
 {
 	struct pmc_dev *pmcdev = platform_get_drvdata(pdev);
+#ifdef CONFIG_X86_PM_TIMER
 	const struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
 	const struct pmc_reg_map *map = pmc->map;
 
 	if (map->acpi_pm_tmr_ctl_offset)
 		acpi_pmtmr_unregister_suspend_resume_callback();
+#endif
 
 	pmc_core_dbgfs_unregister(pmcdev);
 	pmc_core_clean_structure(pdev);
-- 
2.46.0.469.g59c65b2a67-goog



  reply	other threads:[~2024-12-05 15:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-08 18:59 [linux-next:master 7987/10296] drivers/platform/x86/intel/pmc/core.c:1501:17: error: implicit declaration of function 'acpi_pmtmr_register_suspend_resume_callback' kernel test robot
2024-09-08 20:01 ` Marek Maslanka [this message]
2024-09-09 11:40   ` [PATCH] platform/x86:intel/pmc: Encapsulate callbacks registration in CONFIG_X86_PM_TIMER check Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240908200127.1848844-1-mmaslanka@google.com \
    --to=mmaslanka@google.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox