It seem that the drm core already done this for us, are we really need those #ifdef guard anymore?--- /dev/nullShould probably build the file when debugfs is enabled and provide
+++ b/drivers/gpu/drm/loongson/lsdc_debugfs.c
+void lsdc_debugfs_init(struct drm_minor *minor)
+{
+#ifdef CONFIG_DEBUG_FS
+ drm_debugfs_create_files(lsdc_debugfs_list,
+ ARRAY_SIZE(lsdc_debugfs_list),
+ minor->debugfs_root,
+ minor);
+#endif
+}
no-op stub in the header. See nouveau for an example.