mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "luo.liu" <luo.liu.linux@163.com>
To: sakari.ailus@linux.intel.com, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	luo.liu.linux@163.com
Subject: [PATCH] media:v4l2-async:debugfs for registered subdevices
Date: Fri, 13 Mar 2026 15:58:24 +0800	[thread overview]
Message-ID: <20260313075824.2818713-1-luo.liu.linux@163.com> (raw)

Add a new debugfs file "registered_subdevices" under the "v4l2-async"
directory to display all registered subdevices in the subdev_list. This
helps with debugging by providing a clear view of all currently registered
V4L2 subdevices.

The new file displays each subdevice's name and device path (if available).

Signed-off-by: luo.liu <luo.liu.linux@163.com>
---
 drivers/media/v4l2-core/v4l2-async.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 888a2e213b08..0f90ee268d99 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -966,6 +966,25 @@ static int pending_subdevs_show(struct seq_file *s, void *data)
 }
 DEFINE_SHOW_ATTRIBUTE(pending_subdevs);
 
+static int registered_subdevs_show(struct seq_file *s, void *data)
+{
+	struct v4l2_subdev *sd;
+
+	mutex_lock(&list_lock);
+
+	list_for_each_entry(sd, &subdev_list, async_list) {
+		seq_printf(s, "%s", sd->name);
+		if (sd->dev)
+			seq_printf(s, " (dev: %s)", dev_name(sd->dev));
+		seq_putc(s, '\n');
+	}
+
+	mutex_unlock(&list_lock);
+
+	return 0;
+}
+DEFINE_SHOW_ATTRIBUTE(registered_subdevs);
+
 static struct dentry *v4l2_async_debugfs_dir;
 
 static int __init v4l2_async_init(void)
@@ -974,6 +993,9 @@ static int __init v4l2_async_init(void)
 	debugfs_create_file("pending_async_subdevices", 0444,
 			    v4l2_async_debugfs_dir, NULL,
 			    &pending_subdevs_fops);
+	debugfs_create_file("registered_subdevices", 0444,
+			    v4l2_async_debugfs_dir, NULL,
+			    &registered_subdevs_fops);
 
 	return 0;
 }

base-commit: 5c9e55fecf9365890c64f14761a80f9413a3b1d1
-- 
2.25.1


             reply	other threads:[~2026-03-13  7:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13  7:58 luo.liu [this message]
2026-03-13 10:28 ` Sakari Ailus
2026-03-13 11:21   ` luo.liu.linux
2026-03-13 11:42     ` Sakari Ailus
2026-03-13 13:50       ` luo.liu.linux
2026-03-16 16:48         ` Sakari Ailus
2026-03-17  3:37           ` luo.liu.linux
2026-03-17  8:21             ` Sakari Ailus
2026-03-17 11:14               ` luo.liu.linux
2026-03-19 20:30                 ` Laurent Pinchart
2026-03-20  6:52                   ` luo.liu.linux

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=20260313075824.2818713-1-luo.liu.linux@163.com \
    --to=luo.liu.linux@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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

all inboxes | Powered by JetHome®