platform/x86/amd/hsmp: fix building with CONFIG_HWMON=m
Subsystems (2)
PATCH 1/1 platform/x86/amd/hsmp: fix building with CONFIG_HWMON=m
From: Arnd Bergmann <[email protected]>
When CONFIG_HWMON is built as a loadable module, the HSMP drivers cannot be built-in:
ERROR: modpost: "hsmp_create_sensor" [drivers/platform/x86/amd/hsmp/amd_hsmp.ko] undefined!
ERROR: modpost: "hsmp_create_sensor" [drivers/platform/x86/amd/hsmp/hsmp_acpi.ko] undefined!
Enforce that through the usual Kconfig dependnecy trick.
--- drivers/platform/x86/amd/hsmp/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/platform/x86/amd/hsmp/Kconfig +2 -0
@@ -12,6 +12,7 @@ menu "AMD HSMP Driver" config AMD_HSMP_ACPI tristate "AMD HSMP ACPI device driver" depends on ACPI + depends on HWMON || !HWMON select AMD_HSMP help Host System Management Port (HSMP) interface is a mailbox interface
@@ -29,6 +30,7 @@ config AMD_HSMP_ACPI config AMD_HSMP_PLAT tristate "AMD HSMP platform device driver" + depends on HWMON || !HWMON select AMD_HSMP help Host System Management Port (HSMP) interface is a mailbox interface
Signature · 1 line
2.39.5
Hi Arnd,
Quoted 24 lines · Arnd Bergmann
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
From: Arnd Bergmann <[email protected]>
When
CONFIG_HWMONis built as a loadable module, the HSMP drivers cannot be built-in:ERROR: modpost: "
hsmp_create_sensor" [drivers/platform/x86/amd/hsmp/amd_hsmp.ko] undefined!
ERROR: modpost: "hsmp_create_sensor" [drivers/platform/x86/amd/hsmp/hsmp_acpi.ko] undefined!Enforce that through the usual
Kconfigdependnecy trick.Fixes 92c025db52bb ("platform/x86/amd/hsmp: Report power via hwmon sensors")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/platform/x86/amd/hsmp/Kconfig | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/amd/hsmp/Kconfig +0
-0
drivers/platform/x86/amd/hsmp/Kconfig menu "AMD HSMP Driver" · line 15
Quoted 4 lines
drivers/platform/x86/amd/hsmp/Kconfig +1
-0@@ -12,6 +12,7 @@ menu "AMD HSMP Driver" config AMD_HSMP_ACPI tristate "AMD HSMP ACPI device driver" depends on ACPI + depends on HWMON || !HWMON
Thanks for sending this fix. I verified it.
Along with this fix, I will change IS_REACHABLE() to IS_ENABLED() in hsmp.h as its not necessary and send v2 of this patch.
-#if IS_REACHABLE(CONFIG_HWMON)
+#if IS_ENABLED(CONFIG_HWMON)
int hsmp_create_sensor(struct device *dev, u16 sock_ind);
#else
static inline int hsmp_create_sensor(struct device *dev, u16 sock_ind) { return 0; } #endif
Quoted 12 lines
drivers/platform/x86/amd/hsmp/Kconfig +1
-1select AMD_HSMP help Host System Management Port (HSMP) interface is a mailbox interface@@ -29,6 +30,7 @@ config AMD_HSMP_ACPI config AMD_HSMP_PLAT tristate "AMD HSMP platform device driver" + depends on HWMON || !HWMON select AMD_HSMP help Host System Management Port (HSMP) interface is a mailbox interface --
Quoted 1 line
2.39.5
Thanks and Regards,
Suma
Ilpo Järvinen
maintainerQuoted 58 lines · Suma Hegde
Hi Arnd,
Quoted 29 lines · Arnd Bergmann
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
From: Arnd Bergmann <[email protected]>
When
CONFIG_HWMONis built as a loadable module, the HSMP drivers cannot be built-in:ERROR: modpost: "
hsmp_create_sensor" [drivers/platform/x86/amd/hsmp/amd_hsmp.ko] undefined!
ERROR: modpost: "hsmp_create_sensor" [drivers/platform/x86/amd/hsmp/hsmp_acpi.ko] undefined!Enforce that through the usual
Kconfigdependnecy trick.Fixes 92c025db52bb ("platform/x86/amd/hsmp: Report power via hwmonsensors")
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/platform/x86/amd/hsmp/Kconfig | 2 ++ 1 file changed, 2 insertions(+)drivers/platform/x86/amd/hsmp/Kconfig +0
-0drivers/platform/x86/amd/hsmp/Kconfig menu "AMD HSMP Driver" · line 15
Quoted 4 lines
drivers/platform/x86/amd/hsmp/Kconfig +1
-0@@ -12,6 +12,7 @@ menu "AMD HSMP Driver" config AMD_HSMP_ACPI tristate "AMD HSMP ACPI device driver" depends on ACPI + depends on HWMON || !HWMONThanks for sending this fix. I verified it.
Along with this fix, I will change
IS_REACHABLE()toIS_ENABLED()inhsmp.has its not necessary and send v2 of this patch.(quoted diff) +1
-1-#if IS_REACHABLE(CONFIG_HWMON) +#if IS_ENABLED(CONFIG_HWMON)int
hsmp_create_sensor(struct device *dev, u16 sock_ind); #else
static inline inthsmp_create_sensor(struct device *dev, u16 sock_ind){ return 0; }
#endifQuoted 6 lines
drivers/platform/x86/amd/hsmp/Kconfig +0
-0select AMD_HSMP help Host System Management Port (HSMP) interface is a mailboxinterface
drivers/platform/x86/amd/hsmp/Kconfig +0
-0@@ -29,6 +30,7 @@ config AMD_HSMP_ACPI
Quoted 7 lines
Quoted 7 lines
drivers/platform/x86/amd/hsmp/Kconfig +1
-0config AMD_HSMP_PLAT tristate "AMD HSMP platform device driver" + depends on HWMON || !HWMON select AMD_HSMP help Host System Management Port (HSMP) interface is a mailboxinterface
Hi,
I've taken Arnd's patch now as the merge window is pressing in and this issue is disturbing build testing.
Signature · 1 line
i.