platform/x86/amd: pmc: remove CONFIG_SUSPEND checks
authorArnd Bergmann <arnd@arndb.de>
Tue, 14 Feb 2023 15:25:07 +0000 (16:25 +0100)
committerHans de Goede <hdegoede@redhat.com>
Tue, 7 Mar 2023 10:37:27 +0000 (11:37 +0100)
commit24efcdf03d85bb73df0ba99f69c8d238e7ada0e5
tree16d60d0310198281fe9f867b27b43001823c5349
parentfe15c26ee26efa11741a7b632e9f23b01aca4cc6
platform/x86/amd: pmc: remove CONFIG_SUSPEND checks

The amd_pmc_write_stb() function was previously hidden in an
ifdef to avoid a warning when CONFIG_SUSPEND is disabled, but
now there is an additional caller:

drivers/platform/x86/amd/pmc.c: In function 'amd_pmc_stb_debugfs_open_v2':
drivers/platform/x86/amd/pmc.c:256:8: error: implicit declaration of function 'amd_pmc_write_stb'; did you mean 'amd_pmc_read_stb'? [-Werror=implicit-function-declaration]
  256 |  ret = amd_pmc_write_stb(dev, AMD_PMC_STB_DUMMY_PC);
      |        ^~~~~~~~~~~~~~~~~
      |        amd_pmc_read_stb

There is now an easier way to handle this using DEFINE_SIMPLE_DEV_PM_OPS()
to replace all the #ifdefs, letting gcc drop any of the unused functions
silently.

Fixes: b0d4bb973539 ("platform/x86/amd: pmc: Write dummy postcode into the STB DRAM")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230214152512.806188-1-arnd@kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/amd/pmc.c