[Intel-gfx] [PATCH 4/6] drm/i915: Use new drm debugfs file helper

Ben Widawsky benjamin.widawsky at intel.com
Tue Jan 21 21:33:20 CET 2014


The debugfs helper duplicates the functionality used by Armada, so let's
just use that.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 473dda2..72b8388 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -3221,24 +3221,6 @@ static int i915_forcewake_create(struct dentry *root, struct drm_minor *minor)
 	return drm_add_fake_info_node(minor, ent, &i915_forcewake_fops);
 }
 
-static int i915_debugfs_create(struct dentry *root,
-			       struct drm_minor *minor,
-			       const char *name,
-			       const struct file_operations *fops)
-{
-	struct drm_device *dev = minor->dev;
-	struct dentry *ent;
-
-	ent = debugfs_create_file(name,
-				  S_IRUGO | S_IWUSR,
-				  root, dev,
-				  fops);
-	if (!ent)
-		return -ENOMEM;
-
-	return drm_add_fake_info_node(minor, ent, fops);
-}
-
 static const struct drm_info_list i915_debugfs_list[] = {
 	{"i915_capabilities", i915_capabilities, 0},
 	{"i915_gem_objects", i915_gem_object_info, 0},
@@ -3328,9 +3310,10 @@ int i915_debugfs_init(struct drm_minor *minor)
 	}
 
 	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
-		ret = i915_debugfs_create(minor->debugfs_root, minor,
-					  i915_debugfs_files[i].name,
-					  i915_debugfs_files[i].fops);
+		ret = drm_debugfs_create_file(minor->debugfs_root, minor,
+					      i915_debugfs_files[i].name,
+					      i915_debugfs_files[i].fops,
+					      S_IRUGO | S_IWUSR);
 		if (ret)
 			return ret;
 	}
-- 
1.8.5.3




More information about the Intel-gfx mailing list