summaryrefslogtreecommitdiff
path: root/nuttx/drivers/mtd
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-08-31 17:26:36 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-08-31 17:26:36 -0600
commit39c90ce1ce01a0b45451df19c1635240d47aaf29 (patch)
tree3814c0a5ce1961e161e268801e0529a926100ffb /nuttx/drivers/mtd
parente4f3869daedaf22dd224285cc7f0373e0a5025d2 (diff)
downloadpx4-nuttx-39c90ce1ce01a0b45451df19c1635240d47aaf29.tar.gz
px4-nuttx-39c90ce1ce01a0b45451df19c1635240d47aaf29.tar.bz2
px4-nuttx-39c90ce1ce01a0b45451df19c1635240d47aaf29.zip
Rename kmalloc to kmm_malloc for consistency
Diffstat (limited to 'nuttx/drivers/mtd')
-rw-r--r--nuttx/drivers/mtd/ftl.c4
-rw-r--r--nuttx/drivers/mtd/mtd_config.c10
-rw-r--r--nuttx/drivers/mtd/sector512.c2
-rw-r--r--nuttx/drivers/mtd/smart.c10
-rw-r--r--nuttx/drivers/mtd/sst25.c2
-rw-r--r--nuttx/drivers/mtd/w25.c2
6 files changed, 15 insertions, 15 deletions
diff --git a/nuttx/drivers/mtd/ftl.c b/nuttx/drivers/mtd/ftl.c
index 457967d1b..4e0204972 100644
--- a/nuttx/drivers/mtd/ftl.c
+++ b/nuttx/drivers/mtd/ftl.c
@@ -523,7 +523,7 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd)
/* Allocate a FTL device structure */
- dev = (struct ftl_struct_s *)kmalloc(sizeof(struct ftl_struct_s));
+ dev = (struct ftl_struct_s *)kmm_malloc(sizeof(struct ftl_struct_s));
if (dev)
{
/* Initialize the FTL device structure */
@@ -546,7 +546,7 @@ int ftl_initialize(int minor, FAR struct mtd_dev_s *mtd)
/* Allocate one, in-memory erase block buffer */
#ifdef CONFIG_FS_WRITABLE
- dev->eblock = (FAR uint8_t *)kmalloc(dev->geo.erasesize);
+ dev->eblock = (FAR uint8_t *)kmm_malloc(dev->geo.erasesize);
if (!dev->eblock)
{
fdbg("Failed to allocate an erase block buffer\n");
diff --git a/nuttx/drivers/mtd/mtd_config.c b/nuttx/drivers/mtd/mtd_config.c
index 3e71f2a0a..fcf168b0d 100644
--- a/nuttx/drivers/mtd/mtd_config.c
+++ b/nuttx/drivers/mtd/mtd_config.c
@@ -561,7 +561,7 @@ static off_t mtdconfig_ramconsolidate(FAR struct mtdconfig_struct_s *dev)
/* Allocate a consolidation buffer */
- pBuf = (uint8_t *)kmalloc(dev->erasesize);
+ pBuf = (uint8_t *)kmm_malloc(dev->erasesize);
if (pBuf == NULL)
{
/* Unable to allocate buffer, can't consolidate! */
@@ -730,7 +730,7 @@ static off_t mtdconfig_consolidate(FAR struct mtdconfig_struct_s *dev)
/* Allocate a small buffer for moving data */
- pBuf = (uint8_t *)kmalloc(dev->blocksize);
+ pBuf = (uint8_t *)kmm_malloc(dev->blocksize);
if (pBuf == NULL)
{
return 0;
@@ -1036,7 +1036,7 @@ static int mtdconfig_setconfig(FAR struct mtdconfig_struct_s *dev,
/* Allocate a temp block buffer */
- dev->buffer = (FAR uint8_t *) kmalloc(dev->blocksize);
+ dev->buffer = (FAR uint8_t *) kmm_malloc(dev->blocksize);
/* Read and vaidate the signature bytes */
@@ -1220,7 +1220,7 @@ static int mtdconfig_getconfig(FAR struct mtdconfig_struct_s *dev,
/* Allocate a temp block buffer */
- dev->buffer = (FAR uint8_t *)kmalloc(dev->blocksize);
+ dev->buffer = (FAR uint8_t *)kmm_malloc(dev->blocksize);
if (dev->buffer == NULL)
{
return -ENOMEM;
@@ -1339,7 +1339,7 @@ int mtdconfig_register(FAR struct mtd_dev_s *mtd)
struct mtdconfig_struct_s *dev;
struct mtd_geometry_s geo; /* Device geometry */
- dev = (struct mtdconfig_struct_s *)kmalloc(sizeof(struct mtdconfig_struct_s));
+ dev = (struct mtdconfig_struct_s *)kmm_malloc(sizeof(struct mtdconfig_struct_s));
if (dev)
{
/* Initialize the mtdconfig device structure */
diff --git a/nuttx/drivers/mtd/sector512.c b/nuttx/drivers/mtd/sector512.c
index 7438700c8..f1da6df05 100644
--- a/nuttx/drivers/mtd/sector512.c
+++ b/nuttx/drivers/mtd/sector512.c
@@ -624,7 +624,7 @@ FAR struct mtd_dev_s *s512_initialize(FAR struct mtd_dev_s *mtd)
/* Allocate a buffer for the erase block cache */
- priv->eblock = (FAR uint8_t *)kmalloc(priv->eblocksize);
+ priv->eblock = (FAR uint8_t *)kmm_malloc(priv->eblocksize);
if (!priv->eblock)
{
/* Allocation failed! Discard all of that work we just did and return NULL */
diff --git a/nuttx/drivers/mtd/smart.c b/nuttx/drivers/mtd/smart.c
index 860708f5b..156bbae1f 100644
--- a/nuttx/drivers/mtd/smart.c
+++ b/nuttx/drivers/mtd/smart.c
@@ -517,7 +517,7 @@ static int smart_setsectorsize(struct smart_struct_s *dev, uint16_t size)
totalsectors = dev->neraseblocks * dev->sectorsPerBlk;
dev->totalsectors = (uint16_t) totalsectors;
- dev->sMap = (uint16_t *) kmalloc(totalsectors * sizeof(uint16_t) +
+ dev->sMap = (uint16_t *) kmm_malloc(totalsectors * sizeof(uint16_t) +
(dev->neraseblocks << 1));
if (!dev->sMap)
{
@@ -531,7 +531,7 @@ static int smart_setsectorsize(struct smart_struct_s *dev, uint16_t size)
/* Allocate a read/write buffer */
- dev->rwbuffer = (char *) kmalloc(size);
+ dev->rwbuffer = (char *) kmm_malloc(size);
if (!dev->rwbuffer)
{
fdbg("Error allocating SMART read/write buffer\n");
@@ -823,7 +823,7 @@ static int smart_scan(struct smart_struct_s *dev)
* the SMART device structure and the root directory number.
*/
- rootdirdev = (struct smart_multiroot_device_s*) kmalloc(sizeof(*rootdirdev));
+ rootdirdev = (struct smart_multiroot_device_s*) kmm_malloc(sizeof(*rootdirdev));
if (rootdirdev == NULL)
{
fdbg("Memory alloc failed\n");
@@ -2113,7 +2113,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, const char *partname)
/* Allocate a SMART device structure */
- dev = (struct smart_struct_s *)kmalloc(sizeof(struct smart_struct_s));
+ dev = (struct smart_struct_s *)kmm_malloc(sizeof(struct smart_struct_s));
if (dev)
{
/* Initialize the SMART device structure */
@@ -2192,7 +2192,7 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, const char *partname)
* the SMART device structure and the root directory number.
*/
- rootdirdev = (struct smart_multiroot_device_s*) kmalloc(sizeof(*rootdirdev));
+ rootdirdev = (struct smart_multiroot_device_s*) kmm_malloc(sizeof(*rootdirdev));
if (rootdirdev == NULL)
{
fdbg("register_blockdriver failed: %d\n", -ret);
diff --git a/nuttx/drivers/mtd/sst25.c b/nuttx/drivers/mtd/sst25.c
index 25622c5ef..72d4c14e3 100644
--- a/nuttx/drivers/mtd/sst25.c
+++ b/nuttx/drivers/mtd/sst25.c
@@ -1243,7 +1243,7 @@ FAR struct mtd_dev_s *sst25_initialize(FAR struct spi_dev_s *dev)
#ifdef CONFIG_SST25_SECTOR512 /* Simulate a 512 byte sector */
/* Allocate a buffer for the erase block cache */
- priv->sector = (FAR uint8_t *)kmalloc(1 << priv->sectorshift);
+ priv->sector = (FAR uint8_t *)kmm_malloc(1 << priv->sectorshift);
if (!priv->sector)
{
/* Allocation failed! Discard all of that work we just did and return NULL */
diff --git a/nuttx/drivers/mtd/w25.c b/nuttx/drivers/mtd/w25.c
index f56632e6e..49433d60c 100644
--- a/nuttx/drivers/mtd/w25.c
+++ b/nuttx/drivers/mtd/w25.c
@@ -1175,7 +1175,7 @@ FAR struct mtd_dev_s *w25_initialize(FAR struct spi_dev_s *spi)
#ifdef CONFIG_W25_SECTOR512 /* Simulate a 512 byte sector */
/* Allocate a buffer for the erase block cache */
- priv->sector = (FAR uint8_t *)kmalloc(W25_SECTOR_SIZE);
+ priv->sector = (FAR uint8_t *)kmm_malloc(W25_SECTOR_SIZE);
if (!priv->sector)
{
/* Allocation failed! Discard all of that work we just did and return NULL */