LinuxTV Patchwork [PATCHv4,1/9] cec: fill in cec chardev kobject to ease debugging

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

Comments

Hans Verkuil - March 8, 2019, 1:56 p.m.
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>
---
 drivers/media/cec/cec-core.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c
index cc875dabd765..f5d1578e256a 100644
--- a/drivers/media/cec/cec-core.c
+++ b/drivers/media/cec/cec-core.c
@@ -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) {

Privacy Policy