mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Reanem kzalloc to kmm_zalloc for consistency
This commit is contained in:
+2
-2
@@ -882,14 +882,14 @@ int audio_register(FAR const char *name, FAR struct audio_lowerhalf_s *dev)
|
||||
|
||||
/* Allocate the upper-half data structure */
|
||||
|
||||
upper = (FAR struct audio_upperhalf_s *)kzalloc(sizeof(struct audio_upperhalf_s));
|
||||
upper = (FAR struct audio_upperhalf_s *)kmm_zalloc(sizeof(struct audio_upperhalf_s));
|
||||
if (!upper)
|
||||
{
|
||||
auddbg("Allocation failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Initialize the Audio device structure (it was already zeroed by kzalloc()) */
|
||||
/* Initialize the Audio device structure (it was already zeroed by kmm_zalloc()) */
|
||||
|
||||
sem_init(&upper->exclsem, 0, 1);
|
||||
upper->dev = dev;
|
||||
|
||||
+2
-2
@@ -1375,14 +1375,14 @@ FAR struct audio_lowerhalf_s *
|
||||
|
||||
/* Allocate an instance of our private data structure */
|
||||
|
||||
priv = (FAR struct pcm_decode_s *)kzalloc(sizeof(struct pcm_decode_s));
|
||||
priv = (FAR struct pcm_decode_s *)kmm_zalloc(sizeof(struct pcm_decode_s));
|
||||
if (!priv)
|
||||
{
|
||||
auddbg("ERROR: Failed to allocate driver structure\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Initialize our private data structure. Since kzalloc() was used for
|
||||
/* Initialize our private data structure. Since kmm_zalloc() was used for
|
||||
* the allocation, we need to initialize only non-zero, non-NULL, non-
|
||||
* false fields.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user