diff --git a/drivers/ras/debugfs.h b/drivers/ras/debugfs.h
index 4749ccdeeba1..ab95831e7710 100644
--- a/drivers/ras/debugfs.h
+++ b/drivers/ras/debugfs.h
@@ -4,6 +4,10 @@
#include <linux/debugfs.h>
+#if IS_ENABLED(DEBUG_FS)
struct dentry *ras_get_debugfs_root(void);
+#else
+static inline struct dentry ras_get_debugfs_root(void) { return NULL; }
+#endif / DEBUG_FS /
#endif / RAS_DEBUGFS_H */
this also works, just tested
this time round, `make oldconfig` asks if i want to build RAS_FMPM, i built it as module, compilation succeeds.