From 496e239e65ecdab94358281b3b1346634a1476ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?=
<amadeuszx.slawinski@linux.intel.com>
Date: Fri, 17 Apr 2020 12:47:47 -0400
Subject: [PATCH 19/21] topology: Use bool parser to parse boolean value
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
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 70645126d0bc..cd1a87704681 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;
--
2.16.4