diff mbox series

[2/7] media-devnode: fill in media chardev kobject to ease debugging

Message ID 20190221142148.3412-3-hverkuil-cisco@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series Various core and virtual driver fixes | expand

Commit Message

Hans Verkuil Feb. 21, 2019, 2:21 p.m. UTC
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>
---
 drivers/media/media-devnode.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart Feb. 22, 2019, 11:07 a.m. UTC | #1
Hi Hans,

Thank you for the patch.

On Thu, Feb 21, 2019 at 03:21:43PM +0100, Hans Verkuil wrote:
> 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(+)
> 
> 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);
diff mbox series

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);