summaryrefslogtreecommitdiff
path: root/nuttx/drivers/pwm.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-09 21:12:20 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-09 21:12:20 +0000
commitdda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5 (patch)
tree0af32db840a032a50312791977b7d129def1d5b3 /nuttx/drivers/pwm.c
parent2ac33dcffabd9422659c3b013ed8624c09ae90e4 (diff)
downloadpx4-nuttx-dda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5.tar.gz
px4-nuttx-dda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5.tar.bz2
px4-nuttx-dda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5.zip
More changes for a kernel-mode allocator (more to be done)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5724 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/pwm.c')
-rw-r--r--nuttx/drivers/pwm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nuttx/drivers/pwm.c b/nuttx/drivers/pwm.c
index 62fb4d2fb..6e33c902b 100644
--- a/nuttx/drivers/pwm.c
+++ b/nuttx/drivers/pwm.c
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/pwm.c
*
- * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/fs/fs.h>
#include <nuttx/arch.h>
#include <nuttx/pwm.h>
@@ -587,14 +588,14 @@ int pwm_register(FAR const char *path, FAR struct pwm_lowerhalf_s *dev)
/* Allocate the upper-half data structure */
- upper = (FAR struct pwm_upperhalf_s *)zalloc(sizeof(struct pwm_upperhalf_s));
+ upper = (FAR struct pwm_upperhalf_s *)kzalloc(sizeof(struct pwm_upperhalf_s));
if (!upper)
{
pwmdbg("Allocation failed\n");
return -ENOMEM;
}
- /* Initialize the PWM device structure (it was already zeroed by zalloc()) */
+ /* Initialize the PWM device structure (it was already zeroed by kzalloc()) */
sem_init(&upper->exclsem, 0, 1);
#ifdef CONFIG_PWM_PULSECOUNT