summaryrefslogtreecommitdiff
path: root/nuttx/drivers/mtd/at45db.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 16:40:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 16:40:47 +0000
commit4011b03fa6a6a7889efea3451a3a125faa72c7fc (patch)
treec6a1b2ba8ef824b137cd423a245a8cb1c35a0786 /nuttx/drivers/mtd/at45db.c
parente888bb3a55e974475a87fee0371f4405ddab696e (diff)
downloadpx4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.tar.gz
px4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.tar.bz2
px4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.zip
Fixes for kernel stub builds
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3473 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/mtd/at45db.c')
-rw-r--r--nuttx/drivers/mtd/at45db.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nuttx/drivers/mtd/at45db.c b/nuttx/drivers/mtd/at45db.c
index 201fee0d6..6ca2b12bc 100644
--- a/nuttx/drivers/mtd/at45db.c
+++ b/nuttx/drivers/mtd/at45db.c
@@ -2,7 +2,7 @@
* drivers/mtd/at45db.c
* Driver for SPI-based AT45DB161D (16Mbit)
*
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -59,6 +59,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/arch.h>
#include <nuttx/ioctl.h>
#include <nuttx/spi.h>
@@ -826,7 +827,7 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *spi)
* to be extended to handle multiple FLASH parts on the same SPI bus.
*/
- priv = (FAR struct at45db_dev_s *)malloc(sizeof(struct at45db_dev_s));
+ priv = (FAR struct at45db_dev_s *)kmalloc(sizeof(struct at45db_dev_s));
if (priv)
{
/* Initialize the allocated structure */
@@ -893,6 +894,6 @@ FAR struct mtd_dev_s *at45db_initialize(FAR struct spi_dev_s *spi)
errout:
at45db_unlock(priv);
- free(priv);
+ kfree(priv);
return NULL;
}