Re: Remove Device Nodes

2020-11-20 Thread Ecaterina FEDORENCO
Hello Alan, Gregory, Thank you for your replies. Yes. /dev/mtd1 was instantiated via bchdev_register() call. If I use bchdev_unregister,I noticed that the device is removed from the list. Before bchdev_unregister("/dev/mtd1") I call unlink method, but the inode is not removed because it still ha

Re: Remove Device Nodes

2020-11-18 Thread Gregory Nutt
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 th

Re: Remove Device Nodes

2020-11-18 Thread Gregory Nutt
Calling unlink() on a character driver should work just as Alan describes (provided that the character driver supports the unlink() method).  In the specific case that you ask about about, the /dev/mtdblock1 driver is a block driver. The explanation is still correct, except that it is the bloc

Re: Remove Device Nodes

2020-11-18 Thread Alan Carvalho de Assis
Hello Cate, You can remove a driver by unlinking the device node and closing all open references to the driver (provided that the driver properly implements the unlink method.) nsh> rm /dev/node is one way. Calling unlink() is another. What exactly are you willing to do? Could you please descri

Remove Device Nodes

2020-11-18 Thread Ecaterina FEDORENCO
Hello all, I have a question regarding the device nodes from /dev folder. The sequence I execute is the following: 1. smart_initialize method - creates /dev/smart1d file *mtd_part = mtd_partition(mtd, partoffset, (partsize >> 2) * 8); smart_initialize(1, mtd_part, partname);* *