media: media-devnode: fill in media chardev kobject to ease debugging
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 21 Feb 2019 13:22:41 +0000 (08:22 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 17:21:16 +0000 (13:21 -0400)
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/media-devnode.c

index 6b87a721dc4994c956b2b70686554150dda2d268..61dc05fcc55c5889334ca4076a5df98b83a0283e 100644 (file)
@@ -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);