diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-24 17:35:16 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-24 17:35:16 +0000 |
commit | 9aa229270fa7eb834950b6648bbe077fc8fecb62 (patch) | |
tree | 5a875a7d8cbdcf777ade0ed9e1675e8cbea135b1 /nuttx/drivers/mtd/ftl.c | |
parent | efd389f792aff35cb90b8b85b21eb5f7ff45fc63 (diff) | |
download | px4-nuttx-9aa229270fa7eb834950b6648bbe077fc8fecb62.tar.gz px4-nuttx-9aa229270fa7eb834950b6648bbe077fc8fecb62.tar.bz2 px4-nuttx-9aa229270fa7eb834950b6648bbe077fc8fecb62.zip |
Add a RAM-based MTD device
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3532 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/mtd/ftl.c')
-rwxr-xr-x | nuttx/drivers/mtd/ftl.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/nuttx/drivers/mtd/ftl.c b/nuttx/drivers/mtd/ftl.c index 2aaff1b37..ff3c19345 100755 --- a/nuttx/drivers/mtd/ftl.c +++ b/nuttx/drivers/mtd/ftl.c @@ -135,7 +135,7 @@ static int ftl_open(FAR struct inode *inode) } /**************************************************************************** - * Name: ftl_closel + * Name: ftl_close * * Description: close the block device * @@ -450,9 +450,14 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) * Description: * Initialize to provide a block driver wrapper around an MTD interface * + * Input Parameters: + * minor - The minor device number. The MTD block device will be + * registered as as /dev/mtdblockN where N is the minor number. + * mtd - The MTD device that supports the FLASH interface. + * ****************************************************************************/ -int ftl_initialize(int minor, uint8_t *buffer, FAR struct mtd_dev_s *mtd) +int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd) { struct ftl_struct_s *dev; char devname[16]; @@ -467,12 +472,12 @@ int ftl_initialize(int minor, uint8_t *buffer, FAR struct mtd_dev_s *mtd) } #endif - /* Allocate a ramdisk device structure */ + /* Allocate a FTL device structure */ dev = (struct ftl_struct_s *)kmalloc(sizeof(struct ftl_struct_s)); if (dev) { - /* Initialize the ramdisk device structure */ + /* Initialize the FTL device structure */ dev->mtd = mtd; @@ -535,7 +540,7 @@ int ftl_initialize(int minor, uint8_t *buffer, FAR struct mtd_dev_s *mtd) snprintf(devname, 16, "/dev/mtdblock%d", minor); - /* Inode private data is a reference to the ramdisk device stgructure */ + /* Inode private data is a reference to the FTL device structure */ ret = register_blockdriver(devname, &g_bops, 0, dev); if (ret < 0) |