Commit 7ddd4cd5 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

ASoC: dapm: Remove always true path source/sink checks

A path has always a valid source and a valid sink otherwise we wouldn't add
it in the first place. Hence all tests that check if sink/source is non NULL
always evaluate to true and can be removed.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent cdc4508b
...@@ -909,7 +909,7 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget, ...@@ -909,7 +909,7 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
trace_snd_soc_dapm_output_path(widget, path); trace_snd_soc_dapm_output_path(widget, path);
if (path->sink && path->connect) { if (path->connect) {
path->walked = 1; path->walked = 1;
path->walking = 1; path->walking = 1;
...@@ -1017,7 +1017,7 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, ...@@ -1017,7 +1017,7 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget,
trace_snd_soc_dapm_input_path(widget, path); trace_snd_soc_dapm_input_path(widget, path);
if (path->source && path->connect) { if (path->connect) {
path->walked = 1; path->walked = 1;
path->walking = 1; path->walking = 1;
...@@ -1219,9 +1219,6 @@ static int dapm_supply_check_power(struct snd_soc_dapm_widget *w) ...@@ -1219,9 +1219,6 @@ static int dapm_supply_check_power(struct snd_soc_dapm_widget *w)
!path->connected(path->source, path->sink)) !path->connected(path->source, path->sink))
continue; continue;
if (!path->sink)
continue;
if (dapm_widget_power_check(path->sink)) if (dapm_widget_power_check(path->sink))
return 1; return 1;
} }
...@@ -1636,12 +1633,9 @@ static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power, ...@@ -1636,12 +1633,9 @@ static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power,
/* If we changed our power state perhaps our neigbours changed /* If we changed our power state perhaps our neigbours changed
* also. * also.
*/ */
list_for_each_entry(path, &w->sources, list_sink) { list_for_each_entry(path, &w->sources, list_sink)
if (path->source) { dapm_widget_set_peer_power(path->source, power, path->connect);
dapm_widget_set_peer_power(path->source, power,
path->connect);
}
}
switch (w->id) { switch (w->id) {
case snd_soc_dapm_supply: case snd_soc_dapm_supply:
case snd_soc_dapm_regulator_supply: case snd_soc_dapm_regulator_supply:
...@@ -1650,12 +1644,9 @@ static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power, ...@@ -1650,12 +1644,9 @@ static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power,
/* Supplies can't affect their outputs, only their inputs */ /* Supplies can't affect their outputs, only their inputs */
break; break;
default: default:
list_for_each_entry(path, &w->sinks, list_source) { list_for_each_entry(path, &w->sinks, list_source)
if (path->sink) {
dapm_widget_set_peer_power(path->sink, power, dapm_widget_set_peer_power(path->sink, power,
path->connect); path->connect);
}
}
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment