diff options
| author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-08-28 16:24:07 +0200 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2024-10-12 10:44:05 +0200 |
| commit | ccb32f2357c08f64947e0fc32f9a9551ae69c6b3 (patch) | |
| tree | 54557e9c60e8591ba4a5f594cf50a99dc9579d3d /include/media | |
| parent | bfe703ac0c9f42fd54ec46416146f46d9502bc8c (diff) | |
| download | linux-ccb32f2357c08f64947e0fc32f9a9551ae69c6b3.tar.gz linux-ccb32f2357c08f64947e0fc32f9a9551ae69c6b3.tar.bz2 linux-ccb32f2357c08f64947e0fc32f9a9551ae69c6b3.zip | |
media: v4l2-core: add v4l2_debugfs_root()
This new function returns the dentry of the top-level debugfs "v4l2"
directory. If it does not exist yet, then it is created first.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'include/media')
| -rw-r--r-- | include/media/v4l2-dev.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index d82dfdbf6e58..1b6222fab24e 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h @@ -62,6 +62,7 @@ struct v4l2_ioctl_callbacks; struct video_device; struct v4l2_device; struct v4l2_ctrl_handler; +struct dentry; /** * enum v4l2_video_device_flags - Flags used by &struct video_device @@ -539,6 +540,20 @@ static inline int video_is_registered(struct video_device *vdev) return test_bit(V4L2_FL_REGISTERED, &vdev->flags); } +/** + * v4l2_debugfs_root - returns the dentry of the top-level "v4l2" debugfs dir + * + * If this directory does not yet exist, then it will be created. + */ +#ifdef CONFIG_DEBUG_FS +struct dentry *v4l2_debugfs_root(void); +#else +static inline struct dentry *v4l2_debugfs_root(void) +{ + return NULL; +} +#endif + #if defined(CONFIG_MEDIA_CONTROLLER) /** |
