All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next v3] misc: rtsx: fix build for CONFIG_PM not set
@ 2022-02-27 19:02 Randy Dunlap
  0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2022-02-27 19:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Wei WANG, Kai-Heng Feng, Greg Kroah-Hartman, Arnd Bergmann

When CONFG_WERROR=y and CONFIG_PM is not set, there are fatal build
errors, so use appropriate macros for SYSTEM_SLEEP and RUNTIME_SLEEP
PM_OPS to prevent these. The #ifdef CONFIG_PM / #endif blocks
can also be removed since any dead code will be dropped by them.

../drivers/misc/cardreader/rtsx_pcr.c:1057:13: error: ‘rtsx_enable_aspm’ defined but not used [-Werror=unused-function]
 static void rtsx_enable_aspm(struct rtsx_pcr *pcr)
miscread001.out:../drivers/misc/cardreader/rtsx_pcr.c:1065:13: error: ‘rtsx_comm_pm_power_saving’ defined but not used [-Werror=unused-function]
miscread001.out: static void rtsx_comm_pm_power_saving(struct rtsx_pcr *pcr)
../drivers/misc/cardreader/rtsx_pcr.c:1084:13: error: ‘rtsx_pm_power_saving’ defined but not used [-Werror=unused-function]
 static void rtsx_pm_power_saving(struct rtsx_pcr *pcr)

Fixes: 597568e8df04 ("misc: rtsx: Rework runtime power management flow")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Wei WANG <wei_wang@realsil.com.cn>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Paul Cercueil <paul@crapouillou.net>
---
v3: Use SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() to avoid the build
    errors. This eliminates the need for #ifdef CONFIG_PM/#endif
    blocks of code and of __maybe_unused.

 drivers/misc/cardreader/rtsx_pcr.c |   14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

--- linux-next-20220225.orig/drivers/misc/cardreader/rtsx_pcr.c
+++ linux-next-20220225/drivers/misc/cardreader/rtsx_pcr.c
@@ -1699,7 +1699,6 @@ out:
 	return ret;
 }
 
-#ifdef CONFIG_PM
 
 static void rtsx_pci_shutdown(struct pci_dev *pcidev)
 {
@@ -1784,17 +1783,10 @@ static int rtsx_pci_runtime_resume(struc
 	return 0;
 }
 
-#else /* CONFIG_PM */
-
-#define rtsx_pci_shutdown NULL
-#define rtsx_pci_runtime_suspend NULL
-#define rtsx_pic_runtime_resume NULL
-
-#endif /* CONFIG_PM */
-
 static const struct dev_pm_ops rtsx_pci_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(rtsx_pci_suspend, rtsx_pci_resume)
-	SET_RUNTIME_PM_OPS(rtsx_pci_runtime_suspend, rtsx_pci_runtime_resume, rtsx_pci_runtime_idle)
+	SYSTEM_SLEEP_PM_OPS(rtsx_pci_suspend, rtsx_pci_resume)
+	RUNTIME_PM_OPS(rtsx_pci_runtime_suspend, rtsx_pci_runtime_resume,
+		       rtsx_pci_runtime_idle)
 };
 
 static struct pci_driver rtsx_pci_driver = {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-27 19:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-27 19:02 [PATCH -next v3] misc: rtsx: fix build for CONFIG_PM not set Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.