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:
wangbowen6
2022-09-05 09:49:57 +08:00
committed by Xiang Xiao
parent 2892f18f15
commit 25c2f3e042
5 changed files with 110 additions and 24 deletions
+38
View File
@@ -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
*