diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-06 16:40:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-06 16:40:47 +0000 |
commit | 4011b03fa6a6a7889efea3451a3a125faa72c7fc (patch) | |
tree | c6a1b2ba8ef824b137cd423a245a8cb1c35a0786 /nuttx/drivers/mtd/m25px.c | |
parent | e888bb3a55e974475a87fee0371f4405ddab696e (diff) | |
download | px4-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/m25px.c')
-rw-r--r-- | nuttx/drivers/mtd/m25px.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nuttx/drivers/mtd/m25px.c b/nuttx/drivers/mtd/m25px.c index 18b9aea02..474006c7f 100644 --- a/nuttx/drivers/mtd/m25px.c +++ b/nuttx/drivers/mtd/m25px.c @@ -2,7 +2,7 @@ * drivers/mtd/m25px.c * Driver for SPI-based M25P1 (128Kbit), M25P64 (64Mbit), and M25P128 (128Mbit) FLASH * - * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -47,6 +47,7 @@ #include <errno.h> #include <debug.h> +#include <nuttx/kmalloc.h> #include <nuttx/ioctl.h> #include <nuttx/spi.h> #include <nuttx/mtd.h> @@ -673,7 +674,7 @@ FAR struct mtd_dev_s *m25p_initialize(FAR struct spi_dev_s *dev) * to be extended to handle multiple FLASH parts on the same SPI bus. */ - priv = (FAR struct m25p_dev_s *)malloc(sizeof(struct m25p_dev_s)); + priv = (FAR struct m25p_dev_s *)kmalloc(sizeof(struct m25p_dev_s)); if (priv) { /* Initialize the allocated structure */ @@ -697,7 +698,7 @@ FAR struct mtd_dev_s *m25p_initialize(FAR struct spi_dev_s *dev) /* Unrecognized! Discard all of that work we just did and return NULL */ fdbg("Unrecognized\n"); - free(priv); + kfree(priv); priv = NULL; } } |