linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: benjamin.widawsky@intel.com (Ben Widawsky)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] drm/armada: Use new drm debugfs file helper
Date: Tue, 21 Jan 2014 12:33:18 -0800	[thread overview]
Message-ID: <1390336402-2049-2-git-send-email-benjamin.widawsky@intel.com> (raw)
In-Reply-To: <1390336402-2049-1-git-send-email-benjamin.widawsky@intel.com>

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

WARNING: Not even compile tested. I can compile test this if required,
but I figured there'd be other kind people who already have the cross
toolchain setup.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/armada/armada_debugfs.c | 40 ++++-----------------------------
 1 file changed, 4 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
index 471e456..64e4361 100644
--- a/drivers/gpu/drm/armada/armada_debugfs.c
+++ b/drivers/gpu/drm/armada/armada_debugfs.c
@@ -107,38 +107,6 @@ static struct drm_info_list armada_debugfs_list[] = {
 };
 #define ARMADA_DEBUGFS_ENTRIES ARRAY_SIZE(armada_debugfs_list)
 
-static int drm_add_fake_info_node(struct drm_minor *minor, struct dentry *ent,
-	const void *key)
-{
-	struct drm_info_node *node;
-
-	node = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
-	if (node == NULL) {
-		debugfs_remove(ent);
-		return -ENOMEM;
-	}
-
-	node->minor = minor;
-	node->dent = ent;
-	node->info_ent = (void *) key;
-
-	mutex_lock(&minor->debugfs_lock);
-	list_add(&node->list, &minor->debugfs_list);
-	mutex_unlock(&minor->debugfs_lock);
-
-	return 0;
-}
-
-static int armada_debugfs_create(struct dentry *root, struct drm_minor *minor,
-	const char *name, umode_t mode, const struct file_operations *fops)
-{
-	struct dentry *de;
-
-	de = debugfs_create_file(name, mode, root, minor->dev, fops);
-
-	return drm_add_fake_info_node(minor, de, fops);
-}
-
 int armada_drm_debugfs_init(struct drm_minor *minor)
 {
 	int ret;
@@ -149,13 +117,13 @@ int armada_drm_debugfs_init(struct drm_minor *minor)
 	if (ret)
 		return ret;
 
-	ret = armada_debugfs_create(minor->debugfs_root, minor,
-				   "reg", S_IFREG | S_IRUSR, &fops_reg_r);
+	ret = drm_debugfs_create_file(minor->debugfs_root, minor, "reg",
+				      S_IFREG | S_IRUSR, &fops_reg_r);
 	if (ret)
 		goto err_1;
 
-	ret = armada_debugfs_create(minor->debugfs_root, minor,
-				"reg_wr", S_IFREG | S_IWUSR, &fops_reg_w);
+	ret = drm_debugfs_create_file(minor->debugfs_root, minor,
+				      "reg_wr", S_IFREG | S_IWUSR, &fops_reg_w);
 	if (ret)
 		goto err_2;
 	return ret;
-- 
1.8.5.3

      reply	other threads:[~2014-01-21 20:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 14:14 [PATCH 1/2] drm: share drm_add_fake_info_node Ben Widawsky
2014-01-14 23:25 ` [Intel-gfx] " Daniel Vetter
2014-01-14 23:40   ` Russell King - ARM Linux
2014-01-15  8:39     ` Daniel Vetter
2014-01-15  8:45       ` Daniel Vetter
2014-01-15 20:08         ` Ben Widawsky
2014-01-15 23:42           ` Daniel Vetter
2014-01-21 19:05             ` Ben Widawsky
2014-01-21 20:33 ` [PATCH 1/6] drm: Create a debugfs file creation helper Ben Widawsky
2014-01-21 20:33   ` Ben Widawsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390336402-2049-2-git-send-email-benjamin.widawsky@intel.com \
    --to=benjamin.widawsky@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).