All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH alsa-lib] Fix build with --disable-ucm
@ 2021-06-27 22:35 Michael Forney
  2021-06-28 10:16 ` Jaroslav Kysela
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Forney @ 2021-06-27 22:35 UTC (permalink / raw
  To: alsa-devel

A recent change introduced a dependency on ucm to several of the
other components, but this was not made conditional on whether
BUILD_UCM is enabled.

Signed-off-by: Michael Forney <mforney@mforney.org>
---
 src/control/control.c | 5 ++++-
 src/pcm/pcm.c         | 5 ++++-
 src/rawmidi/rawmidi.c | 5 ++++-
 src/seq/seq.c         | 5 ++++-
 src/timer/timer.c     | 5 ++++-
 5 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/control/control.c b/src/control/control.c
index 91415b51..ca302df6 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -1569,11 +1569,14 @@ int snd_ctl_open(snd_ctl_t **ctlp, const char *name, int mode)
 	int err;
 
 	assert(ctlp && name);
+#ifdef BUILD_UCM
 	if (_snd_is_ucm_device(name)) {
 		name = uc_mgr_alibcfg_by_device(&top, name);
 		if (name == NULL)
 			return -ENODEV;
-	} else {
+	} else
+#endif
+	{
 		err = snd_config_update_ref(&top);
 		if (err < 0)
 			return err;
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 892abf98..67912794 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -2686,11 +2686,14 @@ int snd_pcm_open(snd_pcm_t **pcmp, const char *name,
 	int err;
 
 	assert(pcmp && name);
+#ifdef BUILD_UCM
 	if (_snd_is_ucm_device(name)) {
 		name = uc_mgr_alibcfg_by_device(&top, name);
 		if (name == NULL)
 			return -ENODEV;
-	} else {
+	} else
+#endif
+	{
 		err = snd_config_update_ref(&top);
 		if (err < 0)
 			return err;
diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c
index 55f44821..f6a60611 100644
--- a/src/rawmidi/rawmidi.c
+++ b/src/rawmidi/rawmidi.c
@@ -304,11 +304,14 @@ int snd_rawmidi_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
 	int err;
 
 	assert((inputp || outputp) && name);
+#ifdef BUILD_UCM
 	if (_snd_is_ucm_device(name)) {
 		name = uc_mgr_alibcfg_by_device(&top, name);
 		if (name == NULL)
 			return -ENODEV;
-	} else {
+	} else
+#endif
+	{
 		err = snd_config_update_ref(&top);
 		if (err < 0)
 			return err;
diff --git a/src/seq/seq.c b/src/seq/seq.c
index f051426f..3330e770 100644
--- a/src/seq/seq.c
+++ b/src/seq/seq.c
@@ -978,11 +978,14 @@ int snd_seq_open(snd_seq_t **seqp, const char *name,
 	int err;
 
 	assert(seqp && name);
+#if BUILD_UCM
 	if (_snd_is_ucm_device(name)) {
 		name = uc_mgr_alibcfg_by_device(&top, name);
 		if (name == NULL)
 			return -ENODEV;
-	} else {
+	} else
+#endif
+	{
 		err = snd_config_update_ref(&top);
 		if (err < 0)
 			return err;
diff --git a/src/timer/timer.c b/src/timer/timer.c
index 6fc710b9..52400058 100644
--- a/src/timer/timer.c
+++ b/src/timer/timer.c
@@ -205,11 +205,14 @@ int snd_timer_open(snd_timer_t **timer, const char *name, int mode)
 	int err;
 
 	assert(timer && name);
+#ifdef BUILD_UCM
 	if (_snd_is_ucm_device(name)) {
 		name = uc_mgr_alibcfg_by_device(&top, name);
 		if (name == NULL)
 			return -ENODEV;
-	} else {
+	} else
+#endif
+	{
 		err = snd_config_update_ref(&top);
 		if (err < 0)
 			return err;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH alsa-lib] Fix build with --disable-ucm
  2021-06-27 22:35 [PATCH alsa-lib] Fix build with --disable-ucm Michael Forney
@ 2021-06-28 10:16 ` Jaroslav Kysela
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Kysela @ 2021-06-28 10:16 UTC (permalink / raw
  To: ALSA development; +Cc: Michael Forney

On 28. 06. 21 0:35, Michael Forney wrote:
> A recent change introduced a dependency on ucm to several of the
> other components, but this was not made conditional on whether
> BUILD_UCM is enabled.

Thank you for your patch. I fixed this using inline functions:

https://github.com/alsa-project/alsa-lib/commit
/f4f29d42be8b8ad60ea4c5697374adad4bfe6868

				Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-28 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-27 22:35 [PATCH alsa-lib] Fix build with --disable-ucm Michael Forney
2021-06-28 10:16 ` Jaroslav Kysela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.