[PATCH 01/14] chardev: add helper function to register char devs with a struct device

Logan Gunthorpe logang at deltatee.com
Mon Feb 20 22:35:21 PST 2017



On 20/02/17 10:35 PM, Dmitry Torokhov wrote:
> My only objection is to this statement. There is absolutely nothing that
> prevents from calling device_unregister() first and cdev_del() later.
> Refcounting will sort it all out.

Yeah, I was really trying to warn people against calling cdev_del within
the release function of the device. If you do that, then the cdev
reference will block the device from ever getting released.

Certainly, you could call device_unregister followed by cdev_del. I
could reword this if you feel it necessary.

Logan





More information about the linux-mtd mailing list