Skip to contentSkip to conversation

hwmon: (nzxt-smart2) Fix build with CONFIG_PM=n

PATCH In review YueHaibing 2 participants 2 messages Jan 4, 2022 Hardware monitoring

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 hwmon: (nzxt-smart2) Fix build with CONFIG_PM=n

drivers/hwmon/nzxt-smart2.c:707:12: error: 'nzxt_smart2_hid_reset_resume' defined but not used [-Werror=unused-function]
707 | static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)

      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Move it into #ifdef block to fix this.

Fixes 0e43f31ee52f ("hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2.")
---
 drivers/hwmon/nzxt-smart2.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hwmon/nzxt-smart2.c +2 -0
index 534d39b8908e..4963d630394a 100644
@@ -704,6 +704,7 @@ static int nzxt_smart2_hid_raw_event(struct hid_device *hdev,
 	return 0;
 }
 
+#ifdef CONFIG_PM
 static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
 {
 	struct drvdata *drvdata = hid_get_drvdata(hdev);
@@ -720,6 +721,7 @@ static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
 
 	return init_device(drvdata, drvdata->update_interval);
 }
+#endif
 
 static int nzxt_smart2_hid_probe(struct hid_device *hdev,
 				 const struct hid_device_id *id)
Signature · 1 line
2.17.1
#1 lore raw
Quoted 34 lines · YueHaibing

drivers/hwmon/nzxt-smart2.c:707:12: error: 'nzxt_smart2_hid_reset_resume' defined but not used [-Werror=unused-function]
707 | static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)

      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Move it into #ifdef block to fix this.

Fixes 0e43f31ee52f ("hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2.")
---
 drivers/hwmon/nzxt-smart2.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hwmon/nzxt-smart2.c +2 -1
index 534d39b8908e..4963d630394a 100644
@@ -704,6 +704,7 @@ static int nzxt_smart2_hid_raw_event(struct hid_device *hdev,
        return 0;
 }
 
+#ifdef CONFIG_PM
 static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
 {
        struct drvdata *drvdata = hid_get_drvdata(hdev);
@@ -720,6 +721,7 @@ static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev)
 
        return init_device(drvdata, drvdata->update_interval);
 }
+#endif
 
 static int nzxt_smart2_hid_probe(struct hid_device *hdev,
                                 const struct hid_device_id *id)
--
Quoted 2 lines

2.17.1

Hi.

It's already fixed:
https://lore.kernel.org/all/[email protected]/
(and already in linux-next:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/hwmon/nzxt-smart2.c?id=f103b2e5a6197586effb0b9a1b72c30b5d65b0cd
)