aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2022-10-17 23:36:42 +0000
committerMark Brown <broonie@kernel.org>2022-10-18 19:16:37 +0100
commitc1329a0f3bde6a655b9e6ce54b1ce47f46fa49f2 (patch)
treede89d7d030a8a0f60896032053c506c320bf9c2e /sound/soc/soc-dapm.c
parentASoC: soc-dapm.c: tidyup error handling on snd_soc_dapm_add_route() (diff)
downloadwireguard-linux-c1329a0f3bde6a655b9e6ce54b1ce47f46fa49f2.tar.xz
wireguard-linux-c1329a0f3bde6a655b9e6ce54b1ce47f46fa49f2.zip
ASoC: soc-dapm.c: remove no meaning variable from snd_soc_dapm_add_path()
snd_soc_dapm_add_path() is using local variable "widgets[]", but it is same as path->node[]. This is no meaning and duplicate operation. This patch removes "widgets[]". path->node[SND_SOC_DAPM_DIR_IN] = wsource; path->node[SND_SOC_DAPM_DIR_OUT] = wsink; widgets[SND_SOC_DAPM_DIR_IN] = wsource; widgets[SND_SOC_DAPM_DIR_OUT] = wsink; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y1teowdx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index b4f876dff994..f9c4fd11853c 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2826,7 +2826,6 @@ static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
int (*connected)(struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink))
{
- struct snd_soc_dapm_widget *widgets[2];
enum snd_soc_dapm_direction dir;
struct snd_soc_dapm_path *path;
int ret;
@@ -2862,8 +2861,6 @@ static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
path->node[SND_SOC_DAPM_DIR_IN] = wsource;
path->node[SND_SOC_DAPM_DIR_OUT] = wsink;
- widgets[SND_SOC_DAPM_DIR_IN] = wsource;
- widgets[SND_SOC_DAPM_DIR_OUT] = wsink;
path->connected = connected;
INIT_LIST_HEAD(&path->list);
@@ -2905,12 +2902,13 @@ static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
}
list_add(&path->list, &dapm->card->paths);
+
snd_soc_dapm_for_each_direction(dir)
- list_add(&path->list_node[dir], &widgets[dir]->edges[dir]);
+ list_add(&path->list_node[dir], &path->node[dir]->edges[dir]);
snd_soc_dapm_for_each_direction(dir) {
- dapm_update_widget_flags(widgets[dir]);
- dapm_mark_dirty(widgets[dir], "Route added");
+ dapm_update_widget_flags(path->node[dir]);
+ dapm_mark_dirty(path->node[dir], "Route added");
}
if (dapm->card->instantiated && path->connect)