From 496e239e65ecdab94358281b3b1346634a1476ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Fri, 17 Apr 2020 12:47:47 -0400 Subject: [PATCH] topology: Use bool parser to parse boolean value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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 Signed-off-by: Jaroslav Kysela --- 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; -- 2.47.3