mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
fs/driver: Add register_mtdpartition() for MTD partition
This commit is contained in:
+30
-1
@@ -641,11 +641,40 @@ int unregister_blockdriver(FAR const char *path);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_MTD
|
||||
#ifdef CONFIG_MTD_PARTITION
|
||||
int register_mtddriver(FAR const char *path, FAR struct mtd_dev_s *mtd,
|
||||
mode_t mode, FAR void *priv);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: register_mtdpartition
|
||||
*
|
||||
* Description:
|
||||
* Register a mtd partition driver inode the pseudo file system.
|
||||
*
|
||||
* Input Parameters:
|
||||
* partition - The path to the partition inode
|
||||
* parent - The path to the parent inode
|
||||
* firstblock - The offset in block to the partition
|
||||
* nblocks - The number of block in the partition
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero on success (with the inode point in 'inode'); A negated errno
|
||||
* value is returned on a failure (all error values returned by
|
||||
* inode_reserve):
|
||||
*
|
||||
* EINVAL - 'path' is invalid for this operation
|
||||
* EEXIST - An inode already exists at 'path'
|
||||
* ENOMEM - Failed to allocate in-memory resources for the operation
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_MTD
|
||||
int register_mtdpartition(FAR const char *partition,
|
||||
mode_t mode, FAR const char *parent,
|
||||
off_t firstblock, size_t nblocks);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: unregister_mtddriver
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user