From: Alexander Usyskin <alexander.usyskin@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Reuven Abliyev <reuven.abliyev@intel.com>,
Alexander Usyskin <alexander.usyskin@intel.com>,
linux-kernel@vger.kernel.org
Subject: [char-misc-next v3 1/5] mei: set parent for char device
Date: Wed, 9 Jul 2025 18:13:40 +0300 [thread overview]
Message-ID: <20250709151344.104942-2-alexander.usyskin@intel.com> (raw)
In-Reply-To: <20250709151344.104942-1-alexander.usyskin@intel.com>
Connect char device to parent device to avoid
parent device unload while char device is
still held open by user-space.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
drivers/misc/mei/main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index 1f5aaf16e300..95d4c1d8e4e6 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -1225,6 +1225,7 @@ int mei_register(struct mei_device *dev, struct device *parent)
devno = MKDEV(MAJOR(mei_devt), dev->minor);
cdev_init(&dev->cdev, &mei_fops);
dev->cdev.owner = parent->driver->owner;
+ cdev_set_parent(&dev->cdev, &parent->kobj);
/* Add the device */
ret = cdev_add(&dev->cdev, devno, 1);
--
2.43.0
next prev parent reply other threads:[~2025-07-09 15:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 15:13 [char-misc-next v3 0/5] mei: fix mei_device lifetime Alexander Usyskin
2025-07-09 15:13 ` Alexander Usyskin [this message]
2025-07-10 5:31 ` [char-misc-next v3 1/5] mei: set parent for char device Greg Kroah-Hartman
2025-07-16 9:47 ` Greg Kroah-Hartman
2025-07-09 15:13 ` [char-misc-next v3 2/5] mei: make char device control its own lifetime Alexander Usyskin
2025-07-16 9:54 ` Greg Kroah-Hartman
2025-07-17 11:54 ` Usyskin, Alexander
2025-07-09 15:13 ` [char-misc-next v3 3/5] mei: bus: use cldev in prints Alexander Usyskin
2025-07-09 15:13 ` [char-misc-next v3 4/5] mei: more prints with client prefix Alexander Usyskin
2025-07-09 15:13 ` [char-misc-next v3 5/5] mei: hook mei_device on class device Alexander Usyskin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250709151344.104942-2-alexander.usyskin@intel.com \
--to=alexander.usyskin@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=reuven.abliyev@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®