The /dev/mtd1 is, I assume, a character driver that was instantiated via bchdev_register().  It should be unlinked first before the block driver.  The bchdev_unlink() method will teardown the /dev/mtd1 instance /*when it can*/. ...

And it cannot do that until all of the open references to the driver are closed.

If you do unlink while there are open references, the name will be removed from the file namespace, but the underlying driver instance will persist and will continue to hold resources until the last reference to the driver is closed.  Then that underlying driver instance will be released.

Reply via email to