You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2022/04/10 18:41:22 UTC
[incubator-nuttx] branch master updated (dd70d29d4e -> 1a6ee1b908)
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
from dd70d29d4e tools/mkdeps: Extend MAX_SHQUOTE to 3072
new f3d20abe07 audio: Return audio_lowerhalf_s pointer instead error code in audio_comp_initialize
new 1a6ee1b908 audio: Don't register audio device if name isn't given in audio_comp_initialize
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
audio/audio_comp.c | 20 ++++++++++++--------
include/nuttx/audio/audio_comp.h | 5 +++--
2 files changed, 15 insertions(+), 10 deletions(-)
[incubator-nuttx] 01/02: audio: Return audio_lowerhalf_s pointer instead error code in audio_comp_initialize
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit f3d20abe0725395f2fdcbe83fdecae8ec41f6dbb
Author: zhangyuebin <zh...@xiaomi.com>
AuthorDate: Tue Nov 9 14:47:49 2021 +0800
audio: Return audio_lowerhalf_s pointer instead error code in audio_comp_initialize
---
audio/audio_comp.c | 11 ++++++-----
include/nuttx/audio/audio_comp.h | 5 +++--
2 files changed, 9 insertions(+), 7 deletions(-)
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
[incubator-nuttx] 02/02: audio: Don't register audio device if name isn't given in audio_comp_initialize
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 1a6ee1b90855a583b5ef11c632d1b5e61af529ab
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Apr 10 03:19:03 2022 +0800
audio: Don't register audio device if name isn't given in audio_comp_initialize
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
audio/audio_comp.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/audio/audio_comp.c b/audio/audio_comp.c
index ad3f929919..5af63994d2 100644
--- a/audio/audio_comp.c
+++ b/audio/audio_comp.c
@@ -969,10 +969,13 @@ FAR struct audio_lowerhalf_s *audio_comp_initialize(FAR const char *name,
}
va_end(ap);
- ret = audio_register(name, &priv->export);
- if (ret < 0)
+ if (name != NULL)
{
- goto free_lower;
+ ret = audio_register(name, &priv->export);
+ if (ret < 0)
+ {
+ goto free_lower;
+ }
}
return &priv->export;