gpu: pvr: move debugfs entries under a new pvr dir
authorImre Deak <imre.deak@nokia.com>
Tue, 14 Dec 2010 01:42:39 +0000 (03:42 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:43:02 +0000 (21:43 +0300)
Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/pvr_debug.c

index 0ac1322..e02d5dd 100644 (file)
@@ -253,7 +253,7 @@ int PVRDebugProcGetLevel(char *page, char **start, off_t off, int count,
 
 #ifdef CONFIG_DEBUG_FS
 
-static struct dentry *debugfs_dentry;
+static struct dentry *debugfs_dir;
 static u32 pvr_reset;
 
 static struct PVRSRV_DEVICE_NODE *get_sgx_node(void)
@@ -323,15 +323,22 @@ DEFINE_SIMPLE_ATTRIBUTE(pvr_dbg_fops, NULL, pvr_dbg_set, "%llu\n");
 
 static int pvr_init_debugfs(void)
 {
-       debugfs_dentry = debugfs_create_file("reset_sgx", S_IWUGO, NULL,
-                       &pvr_reset, &pvr_dbg_fops);
+       debugfs_dir = debugfs_create_dir("pvr", NULL);
+       if (!debugfs_dir)
+               return -ENODEV;
+
+       if (!debugfs_create_file("reset_sgx", S_IWUGO, debugfs_dir, &pvr_reset,
+                                &pvr_dbg_fops)) {
+               debugfs_remove(debugfs_dir);
+               return -ENODEV;
+       }
 
-       return debugfs_dentry ? 0 : -ENODEV;
+       return 0;
 }
 
 static void pvr_cleanup_debugfs(void)
 {
-       debugfs_remove(debugfs_dentry);
+       debugfs_remove_recursive(debugfs_dir);
 }
 
 #else          /* !CONFIG_DEBUG_FS */