public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap: Append device name in the root debugfs dir
@ 2012-02-22 13:53 Dimitris Papastamos
  2012-02-22 13:57 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Dimitris Papastamos @ 2012-02-22 13:53 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
---
 drivers/base/regmap/regmap-debugfs.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index b3b4b8f..f396246 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -179,8 +179,12 @@ static const struct file_operations regmap_access_fops = {
 
 void regmap_debugfs_init(struct regmap *map)
 {
-	map->debugfs = debugfs_create_dir(dev_name(map->dev),
-					  regmap_debugfs_root);
+	char name[64];
+
+	snprintf(name, sizeof(name), "%s-%s",
+		 dev_name(map->dev), map->dev->driver->name);
+
+	map->debugfs = debugfs_create_dir(name, regmap_debugfs_root);
 	if (!map->debugfs) {
 		dev_warn(map->dev, "Failed to create debugfs directory\n");
 		return;
-- 
1.7.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regmap: Append device name in the root debugfs dir
  2012-02-22 13:53 [PATCH] regmap: Append device name in the root debugfs dir Dimitris Papastamos
@ 2012-02-22 13:57 ` Mark Brown
  2012-02-22 14:00   ` Dimitris Papastamos
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2012-02-22 13:57 UTC (permalink / raw)
  To: Dimitris Papastamos; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

On Wed, Feb 22, 2012 at 01:53:03PM +0000, Dimitris Papastamos wrote:

>  void regmap_debugfs_init(struct regmap *map)
>  {
> -	map->debugfs = debugfs_create_dir(dev_name(map->dev),
> -					  regmap_debugfs_root);
> +	char name[64];

That's a magic number, where did it come from?

> +
> +	snprintf(name, sizeof(name), "%s-%s",
> +		 dev_name(map->dev), map->dev->driver->name);
> +
> +	map->debugfs = debugfs_create_dir(name, regmap_debugfs_root);

No, keep the directory name the same and add a new file.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regmap: Append device name in the root debugfs dir
  2012-02-22 13:57 ` Mark Brown
@ 2012-02-22 14:00   ` Dimitris Papastamos
  0 siblings, 0 replies; 3+ messages in thread
From: Dimitris Papastamos @ 2012-02-22 14:00 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

On Wed, Feb 22, 2012 at 01:57:09PM +0000, Mark Brown wrote:
> On Wed, Feb 22, 2012 at 01:53:03PM +0000, Dimitris Papastamos wrote:
> 
> >  void regmap_debugfs_init(struct regmap *map)
> >  {
> > -	map->debugfs = debugfs_create_dir(dev_name(map->dev),
> > -					  regmap_debugfs_root);
> > +	char name[64];
> 
> That's a magic number, where did it come from?

I can try to use something like NAME_MAX I suppose.

> > +
> > +	snprintf(name, sizeof(name), "%s-%s",
> > +		 dev_name(map->dev), map->dev->driver->name);
> > +
> > +	map->debugfs = debugfs_create_dir(name, regmap_debugfs_root);
> 
> No, keep the directory name the same and add a new file.

Right, that was what I had initially implemented but seemed a bit of
overkill, but yea I can do that.

Thanks,
Dimitris

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-22 14:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22 13:53 [PATCH] regmap: Append device name in the root debugfs dir Dimitris Papastamos
2012-02-22 13:57 ` Mark Brown
2012-02-22 14:00   ` Dimitris Papastamos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox