Skip to contentSkip to conversation

drm/bridge: ti-sn65dsi86: use dev name for debugfs

PATCH Applied Rob Clark 4 participants 5 messages Jul 6, 2019 – Jul 16, 2019

Subsystems (5)
lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 drm/bridge: ti-sn65dsi86: use dev name for debugfs

From: Rob Clark <[email protected]>

This should be more future-proof if we ever encounter a device with two of these bridges.

---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi86.c +1 -1
index c8fb45e7b06d..9f4ff88d4a10 100644
@@ -204,7 +204,7 @@ DEFINE_SHOW_ATTRIBUTE(status);
 
 static void ti_sn_debugfs_init(struct ti_sn_bridge *pdata)
 {
-	pdata->debugfs = debugfs_create_dir("ti_sn65dsi86", NULL);
+	pdata->debugfs = debugfs_create_dir(dev_name(pdata->dev), NULL);
 
 	debugfs_create_file("status", 0600, pdata->debugfs, pdata,
 			&status_fops);
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Rob Clark

From: Rob Clark <[email protected]>

This should be more future-proof if we ever encounter a device with two of these bridges.

Quoted 20 lines
---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi86.c +1 -1
index c8fb45e7b06d..9f4ff88d4a10 100644
@@ -204,7 +204,7 @@ DEFINE_SHOW_ATTRIBUTE(status);
 
 static void ti_sn_debugfs_init(struct ti_sn_bridge *pdata)
 {
-	pdata->debugfs = debugfs_create_dir("ti_sn65dsi86", NULL);
+	pdata->debugfs = debugfs_create_dir(dev_name(pdata->dev), NULL);
 
 	debugfs_create_file("status", 0600, pdata->debugfs, pdata,
 			&status_fops);
Signature · 1 line
2.20.1
#2 lore raw
In reply to Rob Clark

Hi Rob,

Thank you for the patch.

Quoted 16 lines · Rob Clark

From: Rob Clark <[email protected]>

This should be more future-proof if we ever encounter a device with two of these bridges.

---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi86.c +0 -0
index c8fb45e7b06d..9f4ff88d4a10 100644

drivers/gpu/drm/bridge/ti-sn65dsi86.c DEFINE_SHOW_ATTRIBUTE(status); · line 207

Quoted 5 lines
drivers/gpu/drm/bridge/ti-sn65dsi86.c +1 -1
@@ -204,7 +204,7 @@ DEFINE_SHOW_ATTRIBUTE(status);
 
 static void ti_sn_debugfs_init(struct ti_sn_bridge *pdata)
 {
-	pdata->debugfs = debugfs_create_dir("ti_sn65dsi86", NULL);
+	pdata->debugfs = debugfs_create_dir(dev_name(pdata->dev), NULL);

That should work, but won't it become quite confusing for users ? I wonder if the directory name shouldn't be prefixed with the driver name. Something like "ti_sn65dsi86:%s", dev_name(pdata->dev).

Quoted 2 lines
drivers/gpu/drm/bridge/ti-sn65dsi86.c +0 -0
 	debugfs_create_file("status", 0600, pdata->debugfs, pdata,
 			&status_fops);
Signature · 7 lines
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#3 lore raw
Quoted 23 lines · Laurent Pinchart

Hi Rob,

Thank you for the patch.

Quoted 17 lines · Rob Clark

From: Rob Clark <[email protected]>

This should be more future-proof if we ever encounter a device with two of these bridges.

---
 drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi86.c +0 -0
index c8fb45e7b06d..9f4ff88d4a10 100644
@@ -204,7 +204,7 @@ DEFINE_SHOW_ATTRIBUTE(status);
 
Quoted 8 lines

drivers/gpu/drm/bridge/ti-sn65dsi86.c DEFINE_SHOW_ATTRIBUTE(status); · line 207

Quoted 4 lines
drivers/gpu/drm/bridge/ti-sn65dsi86.c +1 -1
 static void ti_sn_debugfs_init(struct ti_sn_bridge *pdata)
 {
-     pdata->debugfs = debugfs_create_dir("ti_sn65dsi86", NULL);
+     pdata->debugfs = debugfs_create_dir(dev_name(pdata->dev), NULL);

That should work, but won't it become quite confusing for users ? I wonder if the directory name shouldn't be prefixed with the driver name. Something like "ti_sn65dsi86:%s", dev_name(pdata->dev).

*maybe*, if they are badly named in dt? In the end the target audience is really to help developers and people bringing up a new board, so maybe my way encourages them to use sensible names in dt ;-)

BR,
-R

Quoted 8 lines

drivers/gpu/drm/bridge/ti-sn65dsi86.c DEFINE_SHOW_ATTRIBUTE(status); · line 210

Quoted 3 lines
drivers/gpu/drm/bridge/ti-sn65dsi86.c +0 -0
      debugfs_create_file("status", 0600, pdata->debugfs, pdata,
                      &status_fops);

--
Regards,

Laurent Pinchart