mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 17:33:08 +08:00
driver: move find_mtddriver() to fs.h and add close_mtddriver.c
Rpmsg mtd need a way to find the mtd device according to the mtd device path. Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
This commit is contained in:
@@ -986,6 +986,44 @@ int open_blockdriver(FAR const char *pathname, int mountflags,
|
||||
|
||||
int close_blockdriver(FAR struct inode *inode);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: find_mtddriver
|
||||
*
|
||||
* Description:
|
||||
* Return the inode of the named MTD driver specified by 'pathname'
|
||||
*
|
||||
* Input Parameters:
|
||||
* pathname - the full path to the named MTD driver to be located
|
||||
* ppinode - address of the location to return the inode reference
|
||||
*
|
||||
* Returned Value:
|
||||
* Returns zero on success or a negated errno on failure:
|
||||
*
|
||||
* ENOENT - No MTD driver of this name is registered
|
||||
* ENOTBLK - The inode associated with the pathname is not an MTD driver
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int find_mtddriver(FAR const char *pathname, FAR struct inode **ppinode);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: close_mtddriver
|
||||
*
|
||||
* Description:
|
||||
* Release the inode got by function find_mtddriver()
|
||||
*
|
||||
* Input Parameters:
|
||||
* pinode - pointer to the inode
|
||||
*
|
||||
* Returned Value:
|
||||
* Returns zero on success or a negated errno on failure:
|
||||
*
|
||||
* EINVAL - inode is NULL
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int close_mtddriver(FAR struct inode *pinode);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: fs_fdopen
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user