RE: [char-misc-next v2 1/5] mei: set parent for char device
From: Usyskin, Alexander
Date: Mon Jun 30 2025 - 09:13:12 EST
> Subject: Re: [char-misc-next v2 1/5] mei: set parent for char device
>
> On Mon, Jun 30, 2025 at 12:19:38PM +0300, Alexander Usyskin wrote:
> > Connect char device to parent device to avoid
> > parent device unload while char device is
> > still held open by user-space.
>
> No, that's not what cdev_set_parent() does.
>
https://elixir.bootlin.com/linux/v6.16-rc3/source/fs/char_dev.c#L511
* cdev_set_parent() sets a parent kobject which will be referenced
* appropriately so the parent is not freed before the cdev. This
* should be called before cdev_add.
This is what written there. Is my interpretation wrong?
> Also, why not wrap your lines at 72 columns?
Ops, missed this while preparing series, will fix.
>
> thanks,
>
> greg k-h
- -
Thanks,
Sasha