On 4/1/22 08:53, Mario Limonciello wrote: > Since commit b1f66033cd4e ("platform/x86: amd-pmc: Move to later in the > suspend process") amd-pmc doesn't use traditional suspend resume > callback anymore but relies on functions only created declared when > CONFIG_SUSPEND is set. > > Check for CONFIG_SUSPEND and only use those functions in those > circumstances. > > Fixes: commit b1f66033cd4e ("platform/x86: amd-pmc: Move to later in the suspend process") > Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> > Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx> Yeah, that works except for this part: ../drivers/platform/x86/amd-pmc.c:693:35: error: ‘amd_pmc_s2idle_dev_ops’ defined but not used [-Werror=unused-variable] static struct acpi_s2idle_dev_ops amd_pmc_s2idle_dev_ops = { ^~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors > --- > drivers/platform/x86/amd-pmc.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c > index e9d0dbbb2887..b121686407ff 100644 > --- a/drivers/platform/x86/amd-pmc.c > +++ b/drivers/platform/x86/amd-pmc.c > @@ -859,9 +859,11 @@ static int amd_pmc_probe(struct platform_device *pdev) > > amd_pmc_get_smu_version(dev); > platform_set_drvdata(pdev, dev); > +#ifdef CONFIG_SUSPEND > err = acpi_register_lps0_dev(&amd_pmc_s2idle_dev_ops); > if (err) > dev_warn(dev->dev, "failed to register LPS0 sleep handler, expect increased power consumption\n"); > +#endif > > amd_pmc_dbgfs_register(dev); > return 0; > @@ -875,7 +877,9 @@ static int amd_pmc_remove(struct platform_device *pdev) > { > struct amd_pmc_dev *dev = platform_get_drvdata(pdev); > > +#ifdef CONFIG_SUSPEND > acpi_unregister_lps0_dev(&amd_pmc_s2idle_dev_ops); > +#endif > amd_pmc_dbgfs_unregister(dev); > pci_dev_put(dev->rdev); > mutex_destroy(&dev->lock); thanks. -- ~Randy