media: cec: fill in cec chardev kobject to ease debugging
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 21 Feb 2019 13:21:14 +0000 (08:21 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 19 Mar 2019 17:19:49 +0000 (13:19 -0400)
The cec 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/cec/cec-core.c

index cc875dabd7658a6a99416f540b0706e24b3be838..f5d1578e256a7ac3d3257780aa3299061f3e0d68 100644 (file)
@@ -126,6 +126,7 @@ static int __must_check cec_devnode_register(struct cec_devnode *devnode,
        /* Part 2: Initialize and register the character device */
        cdev_init(&devnode->cdev, &cec_devnode_fops);
        devnode->cdev.owner = owner;
+       kobject_set_name(&devnode->cdev.kobj, "cec%d", devnode->minor);
 
        ret = cdev_device_add(&devnode->cdev, &devnode->dev);
        if (ret) {