diff --git a/audio/audio_comp.c b/audio/audio_comp.c index fd93121d30..ad3f929919 100644 --- a/audio/audio_comp.c +++ b/audio/audio_comp.c @@ -919,14 +919,15 @@ static void audio_comp_callback(FAR void *arg, uint16_t reason, * ... - The list of the lower half audio driver. * * Returned Value: - * Zero on success; a negated errno value on failure. + * struct audio_lowerhalf_s* on success; NULL on failure. * * Note * The variable argument list must be NULL terminated. * ****************************************************************************/ -int audio_comp_initialize(FAR const char *name, ...) +FAR struct audio_lowerhalf_s *audio_comp_initialize(FAR const char *name, + ...) { FAR struct audio_comp_priv_s *priv; va_list ap; @@ -936,7 +937,7 @@ int audio_comp_initialize(FAR const char *name, ...) priv = kmm_zalloc(sizeof(struct audio_comp_priv_s)); if (priv == NULL) { - return ret; + return NULL; } priv->export.ops = &g_audio_comp_ops; @@ -974,11 +975,11 @@ int audio_comp_initialize(FAR const char *name, ...) goto free_lower; } - return OK; + return &priv->export; free_lower: kmm_free(priv->lower); free_priv: kmm_free(priv); - return ret; + return NULL; } diff --git a/include/nuttx/audio/audio_comp.h b/include/nuttx/audio/audio_comp.h index 92650c6599..4a98cb977e 100644 --- a/include/nuttx/audio/audio_comp.h +++ b/include/nuttx/audio/audio_comp.h @@ -65,14 +65,15 @@ extern "C" * ... - The list of the lower half audio driver. * * Returned Value: - * Zero on success; a negated errno value on failure. + * struct audio_lowerhalf_s* on success; NULL on failure. * * Note * The variable argument list must be NULL terminated. * ****************************************************************************/ -int audio_comp_initialize(FAR const char *name, ...); +FAR struct audio_lowerhalf_s *audio_comp_initialize(FAR const char *name, + ...); #undef EXTERN #ifdef __cplusplus