LinuxTV Patchwork [PATCHv4,2/9] media-devnode: fill in media chardev kobject to ease debugging

login
register
mail settings
Submitter Hans Verkuil
Date March 8, 2019, 1:56 p.m.
Message ID <20190308135625.11278-3-hverkuil-cisco@xs4all.nl>
Download mbox | patch
Permalink /patch/54966/
State Accepted
Delegated to: Hans Verkuil
Headers show

Comments

Hans Verkuil - March 8, 2019, 1:56 p.m.
The media chardev kobject has no name, which made it hard to
debug when kobject debugging is turned on.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/media-devnode.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index 6b87a721dc49..61dc05fcc55c 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -251,6 +251,7 @@  int __must_check media_devnode_register(struct media_device *mdev,
 	/* Part 2: Initialize the character device */
 	cdev_init(&devnode->cdev, &media_devnode_fops);
 	devnode->cdev.owner = owner;
+	kobject_set_name(&devnode->cdev.kobj, "media%d", devnode->minor);
 
 	/* Part 3: Add the media and char device */
 	ret = cdev_device_add(&devnode->cdev, &devnode->dev);

Privacy Policy