summaryrefslogtreecommitdiff
path: root/include/linux/adxl.h
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2018-10-31 21:20:20 +0300
committerBorislav Petkov <bp@suse.de>2018-10-31 21:24:21 +0300
commita324e9396ca3d00e1101476ba067b412e0aba232 (patch)
tree3e79aaf1f5c10d5890ca2ce0e233222864aeda82 /include/linux/adxl.h
parentad6e16059d8e00de0887885db11d87cba0bd1512 (diff)
downloadlinux-a324e9396ca3d00e1101476ba067b412e0aba232.tar.xz
EDAC, skx: Fix randconfig builds
The driver depends on the ADXL component glue and selects it. However, ADXL itself implicitly depends on ACPI and in nonsensical randconfig builds like this: # CONFIG_ACPI is not set CONFIG_ACPI_ADXL=y where ACPI is not enabled, the build fails with: drivers/edac/skx_edac.o: In function `skx_mce_check_error': skx_edac.c:(.text+0xab): undefined reference to `adxl_decode' drivers/edac/skx_edac.o: In function `skx_init': skx_edac.c:(.init.text+0x8bf): undefined reference to `adxl_get_component_names' make: *** [vmlinux] Error 1 Add stubs for that case so that the build succeeds. CONFIG_ACPI=n doesn't make any sense for real configurations but this fix will at least silence randconfig builds. Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Tony Luck <tony.luck@intel.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Diffstat (limited to 'include/linux/adxl.h')
-rw-r--r--include/linux/adxl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/adxl.h b/include/linux/adxl.h
index 2a629acb4c3f..2d29f55923e3 100644
--- a/include/linux/adxl.h
+++ b/include/linux/adxl.h
@@ -7,7 +7,12 @@
#ifndef _LINUX_ADXL_H
#define _LINUX_ADXL_H
+#ifdef CONFIG_ACPI_ADXL
const char * const *adxl_get_component_names(void);
int adxl_decode(u64 addr, u64 component_values[]);
+#else
+static inline const char * const *adxl_get_component_names(void) { return NULL; }
+static inline int adxl_decode(u64 addr, u64 component_values[]) { return -EOPNOTSUPP; }
+#endif
#endif /* _LINUX_ADXL_H */