From dd2395162c07e4102fc83878dc394ff63f2eaae8 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Thu, 9 Jan 2025 00:14:41 +0000 Subject: [PATCH] ASoC: remove disable_route_checks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit No driver is using disable_route_checks, let's remove it. Because snd_soc_dapm_add_routes() itself will indicate detail error when failed, this patch removes duplicate dev_err() not only dev_warn() in error case. Signed-off-by: Kuninori Morimoto Suggested-by: Amadeusz Sławiński Tested-by: Amadeusz Sławiński Link: https://patch.msgid.link/87tta8268e.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- include/sound/soc.h | 1 - sound/soc/soc-core.c | 29 ++++------------------------- sound/soc/soc-topology.c | 12 ++---------- 3 files changed, 6 insertions(+), 36 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 4f5d411e3823f..1e09ff0842478 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1118,7 +1118,6 @@ struct snd_soc_card { unsigned int instantiated:1; unsigned int topology_shortname_created:1; unsigned int fully_routed:1; - unsigned int disable_route_checks:1; unsigned int probed:1; unsigned int component_chaining:1; diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 710c278e4f36b..ca1db71740510 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1644,19 +1644,8 @@ static int soc_probe_component(struct snd_soc_card *card, ret = snd_soc_dapm_add_routes(dapm, component->driver->dapm_routes, component->driver->num_dapm_routes); - if (ret < 0) { - if (card->disable_route_checks) { - ret = 0; - dev_info(card->dev, - "%s: disable_route_checks set, ignoring errors on add_routes\n", - __func__); - } else { - dev_err(card->dev, - "%s: snd_soc_dapm_add_routes failed: %d\n", - __func__, ret); - goto err_probe; - } - } + if (ret < 0) + goto err_probe; /* see for_each_card_components */ list_add(&component->card_list, &card->component_dev_list); @@ -2235,18 +2224,8 @@ static int snd_soc_bind_card(struct snd_soc_card *card) ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, card->num_dapm_routes); - if (ret < 0) { - if (card->disable_route_checks) { - dev_info(card->dev, - "%s: disable_route_checks set, ignoring errors on add_routes\n", - __func__); - } else { - dev_err(card->dev, - "%s: snd_soc_dapm_add_routes failed: %d\n", - __func__, ret); - goto probe_end; - } - } + if (ret < 0) + goto probe_end; ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, card->num_of_dapm_routes); diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index ae2d6802cce05..9f4da061eff9e 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1101,16 +1101,8 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg, } ret = snd_soc_dapm_add_routes(dapm, route, 1); - if (ret) { - if (dapm->card->disable_route_checks) { - ret = 0; - dev_info(tplg->dev, - "ASoC: disable_route_checks set, ignoring dapm_add_routes errors\n"); - } else { - dev_err(tplg->dev, "ASoC: dapm_add_routes failed: %d\n", ret); - break; - } - } + if (ret) + break; } return ret; -- 2.39.5