[ALSA-LIB PATCH] topology: Use bool parser to parse boolean value
It should be safe to change this as correct values with int would be 0 or 1 and bool parser handles them correctly.
Signed-off-by: Amadeusz Sławiński amadeuszx.slawinski@linux.intel.com --- src/topology/dapm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/topology/dapm.c b/src/topology/dapm.c index 70645126..cd1a8770 100644 --- a/src/topology/dapm.c +++ b/src/topology/dapm.c @@ -595,7 +595,8 @@ int tplg_parse_dapm_widget(snd_tplg_t *tplg, }
if (strcmp(id, "invert") == 0) { - if (tplg_get_integer(n, &ival, 0)) + ival = snd_config_get_bool(n); + if (ival < 0) return -EINVAL;
widget->invert = ival;
Dne 17. 04. 20 v 18:47 Amadeusz Sławiński napsal(a):
It should be safe to change this as correct values with int would be 0 or 1 and bool parser handles them correctly.
Signed-off-by: Amadeusz Sławiński amadeuszx.slawinski@linux.intel.com
Applied thanks.
Jaroslav
participants (2)
-
Amadeusz Sławiński
-
Jaroslav Kysela