summaryrefslogtreecommitdiff
path: root/nuttx/drivers/usbhost
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/usbhost
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/usbhost')
-rw-r--r--nuttx/drivers/usbhost/usbhost_hidkbd.c9
-rw-r--r--nuttx/drivers/usbhost/usbhost_skeleton.c9
-rw-r--r--nuttx/drivers/usbhost/usbhost_storage.c11
3 files changed, 15 insertions, 14 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_hidkbd.c b/nuttx/drivers/usbhost/usbhost_hidkbd.c
index 74adff7ba..ef880ea75 100644
--- a/nuttx/drivers/usbhost/usbhost_hidkbd.c
+++ b/nuttx/drivers/usbhost/usbhost_hidkbd.c
@@ -53,6 +53,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/fs.h>
#include <nuttx/arch.h>
#include <nuttx/wqueue.h>
@@ -490,7 +491,7 @@ static inline FAR struct usbhost_state_s *usbhost_allocclass(void)
FAR struct usbhost_state_s *priv;
DEBUGASSERT(!up_interrupt_context());
- priv = (FAR struct usbhost_state_s *)malloc(sizeof(struct usbhost_state_s));
+ priv = (FAR struct usbhost_state_s *)kmalloc(sizeof(struct usbhost_state_s));
uvdbg("Allocated: %p\n", priv);;
return priv;
}
@@ -513,12 +514,10 @@ static inline void usbhost_freeclass(FAR struct usbhost_state_s *class)
{
DEBUGASSERT(class != NULL);
- /* Free the class instance (calling sched_free() in case we are executing
- * from an interrupt handler.
- */
+ /* Free the class instance. */
uvdbg("Freeing: %p\n", class);;
- free(class);
+ kfree(class);
}
/****************************************************************************
diff --git a/nuttx/drivers/usbhost/usbhost_skeleton.c b/nuttx/drivers/usbhost/usbhost_skeleton.c
index efb7a58ba..c33dda586 100644
--- a/nuttx/drivers/usbhost/usbhost_skeleton.c
+++ b/nuttx/drivers/usbhost/usbhost_skeleton.c
@@ -47,6 +47,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/fs.h>
#include <nuttx/arch.h>
#include <nuttx/wqueue.h>
@@ -252,7 +253,7 @@ static inline FAR struct usbhost_state_s *usbhost_allocclass(void)
FAR struct usbhost_state_s *priv;
DEBUGASSERT(!up_interrupt_context());
- priv = (FAR struct usbhost_state_s *)malloc(sizeof(struct usbhost_state_s));
+ priv = (FAR struct usbhost_state_s *)kmalloc(sizeof(struct usbhost_state_s));
uvdbg("Allocated: %p\n", priv);;
return priv;
}
@@ -275,12 +276,12 @@ static inline void usbhost_freeclass(FAR struct usbhost_state_s *class)
{
DEBUGASSERT(class != NULL);
- /* Free the class instance (calling sched_free() in case we are executing
- * from an interrupt handler.
+ /* Free the class instance (perhaps calling sched_free() in case we are
+ * executing from an interrupt handler.
*/
uvdbg("Freeing: %p\n", class);;
- free(class);
+ kfree(class);
}
/****************************************************************************
diff --git a/nuttx/drivers/usbhost/usbhost_storage.c b/nuttx/drivers/usbhost/usbhost_storage.c
index 31f6c2aea..118758a60 100644
--- a/nuttx/drivers/usbhost/usbhost_storage.c
+++ b/nuttx/drivers/usbhost/usbhost_storage.c
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/usbhost/usbhost_storage.c
*
- * 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
@@ -47,6 +47,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/fs.h>
#include <nuttx/arch.h>
#include <nuttx/wqueue.h>
@@ -72,7 +73,7 @@
#endif
/* If the create() method is called by the USB host device driver from an
- * interrupt handler, then it will be unable to call malloc() in order to
+ * interrupt handler, then it will be unable to call kmalloc() in order to
* allocate a new class instance. If the create() method is called from the
* interrupt level, then class instances must be pre-allocated.
*/
@@ -378,11 +379,11 @@ static inline FAR struct usbhost_state_s *usbhost_allocclass(void)
FAR struct usbhost_state_s *priv;
/* We are not executing from an interrupt handler so we can just call
- * malloc() to get memory for the class instance.
+ * kmalloc() to get memory for the class instance.
*/
DEBUGASSERT(!up_interrupt_context());
- priv = (FAR struct usbhost_state_s *)malloc(sizeof(struct usbhost_state_s));
+ priv = (FAR struct usbhost_state_s *)kmalloc(sizeof(struct usbhost_state_s));
uvdbg("Allocated: %p\n", priv);;
return priv;
}
@@ -427,7 +428,7 @@ static inline void usbhost_freeclass(FAR struct usbhost_state_s *class)
*/
uvdbg("Freeing: %p\n", class);;
- free(class);
+ kfree(class);
}
#endif