drm/ttm: add debugfs directory v2
[linux-2.6-microblaze.git] / drivers / gpu / drm / ttm / ttm_module.c
index c090643..f656660 100644 (file)
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/sched.h>
+#include <linux/debugfs.h>
 #include <drm/drm_sysfs.h>
 
 #include "ttm_module.h"
 
 static DECLARE_WAIT_QUEUE_HEAD(exit_q);
 static atomic_t device_released;
+struct dentry *ttm_debugfs_root;
 
 static struct device_type ttm_drm_class_type = {
        .name = "ttm",
@@ -77,6 +79,7 @@ static int __init ttm_init(void)
        if (unlikely(ret != 0))
                goto out_no_dev_reg;
 
+       ttm_debugfs_root = debugfs_create_dir("ttm", NULL);
        return 0;
 out_no_dev_reg:
        atomic_set(&device_released, 1);
@@ -94,6 +97,7 @@ static void __exit ttm_exit(void)
         */
 
        wait_event(exit_q, atomic_read(&device_released) == 1);
+       debugfs_remove(ttm_debugfs_root);
 }
 
 module_init(ttm_init);