Skip to contentSkip to conversation

drivers/input/misc/pf1550-onkey.c: fix build with CONFIG_PM_SLEEP=n

PATCH In review Andrew Morton 2 participants 2 messages Feb 14

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/input/misc/pf1550-onkey.c: fix build with CONFIG_PM_SLEEP=n

From: Andrew Morton <[email protected]>
Subject: drivers/input/misc/pf1550-onkey.c: fix build with CONFIG_PM_SLEEP=n
Date: Fri Feb 13 02:39:04 PM PST 2026

riscv randconfig:

drivers/input/misc/pf1550-onkey.c:154:12: error: 'pf1550_onkey_resume' defined but not used [-Werror=unused-function]
154 | static int pf1550_onkey_resume(struct device *dev)

      |            ^~~~~~~~~~~~~~~~~~~
drivers/input/misc/pf1550-onkey.c:133:12: error: 'pf1550_onkey_suspend' defined but not used [-Werror=unused-function]
  133 | static int pf1550_onkey_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Cc Samuel Kayode <[email protected]>
Cc Dmitry Torokhov <[email protected]>
Cc Frank Li <[email protected]>
Cc Sean Nyekjaer <[email protected]>

---

 drivers/input/misc/pf1550-onkey.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/input/misc/pf1550-onkey.c renamed from drivers/input/misc/pf1550-onkey.c~drivers-input-misc-pf1550-onkeyc-fix-build-with-config_pm_sleep=n +2 -0
@@ -130,6 +130,7 @@ static int pf1550_onkey_probe(struct pla
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int pf1550_onkey_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -175,6 +176,7 @@ static int pf1550_onkey_resume(struct de
 
 static SIMPLE_DEV_PM_OPS(pf1550_onkey_pm_ops, pf1550_onkey_suspend,
 			 pf1550_onkey_resume);
+#endif CONFIG_PM_SLEEP
 
 static const struct platform_device_id pf1550_onkey_id[] = {
 	{ "pf1550-onkey", },

_

maintainer
#1 lore raw

Hi Andrew,

Quoted 6 lines · Andrew Morton

From: Andrew Morton <[email protected]>
Subject: drivers/input/misc/pf1550-onkey.c: fix build with CONFIG_PM_SLEEP=n
Date: Fri Feb 13 02:39:04 PM PST 2026

riscv randconfig:

Quoted 7 lines

drivers/input/misc/pf1550-onkey.c:154:12: error: 'pf1550_onkey_resume' defined but not used [-Werror=unused-function]
154 | static int pf1550_onkey_resume(struct device *dev)

      |            ^~~~~~~~~~~~~~~~~~~
drivers/input/misc/pf1550-onkey.c:133:12: error: 'pf1550_onkey_suspend' defined but not used [-Werror=unused-function]
  133 | static int pf1550_onkey_suspend(struct device *dev)
      |            ^~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

Picked the following fix for this:

https://patch.msgid.link/[email protected]

Thanks.

Signature · 1 line
Dmitry