diff mbox

[RFC,2/4] drm: Register drmfs filesystem from drm init

Message ID 1482144146-31605-3-git-send-email-swati.dhingra@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

swati.dhingra@intel.com Dec. 19, 2016, 10:42 a.m. UTC
From: Sourab Gupta <sourab.gupta@intel.com>

The drmfs filesystem will not be registered standalone during kernel init time,
instead it is intended to be initialized/registered during drm initialization.
This again is dependent on CONFIG_DRMFS being defined.

Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
Signed-off-by: Swati Dhingra <swati.dhingra@intel.com>
---
 drivers/gpu/drm/drm_drv.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index f74b7d0..298013c 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -34,6 +34,7 @@ 
 #include <linux/slab.h>
 
 #include <drm/drm_drv.h>
+#include <drm/drmfs.h>
 #include <drm/drmP.h>
 
 #include "drm_crtc_internal.h"
@@ -828,6 +829,7 @@  static void drm_core_exit(void)
 {
 	unregister_chrdev(DRM_MAJOR, "drm");
 	debugfs_remove(drm_debugfs_root);
+	drmfs_fini();
 	drm_sysfs_destroy();
 	idr_destroy(&drm_minors_idr);
 	drm_connector_ida_destroy();
@@ -848,6 +850,10 @@  static int __init drm_core_init(void)
 		goto error;
 	}
 
+	ret = drmfs_init();
+	if (ret < 0)
+		DRM_ERROR("Cannot create DRM FS: %d\n", ret);
+
 	drm_debugfs_root = debugfs_create_dir("dri", NULL);
 	if (!drm_debugfs_root) {
 		ret = -ENOMEM;