]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform/x86/amd/hsmp: Use IS_ENABLED() instead of IS_REACHABLE()
authorSuma Hegde <suma.hegde@amd.com>
Tue, 3 Jun 2025 05:58:07 +0000 (05:58 +0000)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 9 Jun 2025 09:37:02 +0000 (12:37 +0300)
IS_REACHABLE() was required when CONFIG_HWMON was set to m and HSMP to y.
However, commit 69157b00b526 ("platform/x86/amd/hsmp: fix building with
CONFIG_HWMON=m") added a HWMON dependency for HSMP in Kconfig. With
this change, using IS_ENABLED() is sufficient.

Add the missing header file as well.

Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Link: https://lore.kernel.org/r/20250603055807.2503028-1-suma.hegde@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/amd/hsmp/hsmp.h

index 36b5ceea9ac0498273dc7531d1783bbdc6746f2d..0509a442eaae6067a498074301638e017a5d55e0 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/compiler_types.h>
 #include <linux/device.h>
 #include <linux/hwmon.h>
+#include <linux/kconfig.h>
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
 #include <linux/semaphore.h>
@@ -64,7 +65,7 @@ int hsmp_misc_register(struct device *dev);
 int hsmp_get_tbl_dram_base(u16 sock_ind);
 ssize_t hsmp_metric_tbl_read(struct hsmp_socket *sock, char *buf, size_t size);
 struct hsmp_plat_device *get_hsmp_pdev(void);
-#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; }