diff mbox series

[5/6] drm/debugfs: Make the struct drm_debugfs_entry independent of DRM device

Message ID 20230116102815.95063-6-mcanal@igalia.com (mailing list archive)
State New, archived
Headers show
Series drm/debugfs: Make the debugfs structure more generic | expand

Commit Message

Maíra Canal Jan. 16, 2023, 10:28 a.m. UTC
In order to turn the API more expansible to other DRM objects, such as
the struct drm_connector, make the struct drm_debugfs_entry hold a void
pointer and cast the void pointer to the struct drm_device when needed.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
---
 drivers/gpu/drm/drm_debugfs.c | 2 +-
 include/drm/drm_debugfs.h     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 2d1e3072065a..912f5c0a4ad5 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -356,7 +356,7 @@  void drm_debugfs_add_file(struct drm_device *dev, const char *name,
 	entry->file.name = name;
 	entry->file.show = show;
 	entry->file.data = data;
-	entry->dev = dev;
+	entry->object = dev;
 
 	drm_debugfs_list_add(&entry->list, &dev->debugfs_list);
 }
diff --git a/include/drm/drm_debugfs.h b/include/drm/drm_debugfs.h
index b4e22e7d4016..d1243b433997 100644
--- a/include/drm/drm_debugfs.h
+++ b/include/drm/drm_debugfs.h
@@ -131,8 +131,8 @@  struct drm_debugfs_info {
  * drm_debugfs_info on a &struct drm_device.
  */
 struct drm_debugfs_entry {
-	/** @dev: &struct drm_device for this node. */
-	struct drm_device *dev;
+	/** @object: The DRM object that owns this node. */
+	void *object;
 
 	/** @file: Template for this node. */
 	struct drm_debugfs_info file;