summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorLars-Peter Clausen2014-10-20 19:36:34 +0200
committerMark Brown2014-10-22 13:02:33 +0200
commit7ddd4cd5c31ccaf32febe52462f9fdc915893212 (patch)
treef940ab801033520495deedb7063fa5f44d5375fd /sound/soc/soc-dapm.c
parentASoC: dapm: Reduce number of checked paths in dapm_widget_in_card_paths() (diff)
downloadkernel-qcow2-linux-7ddd4cd5c31ccaf32febe52462f9fdc915893212.tar.gz
kernel-qcow2-linux-7ddd4cd5c31ccaf32febe52462f9fdc915893212.tar.xz
kernel-qcow2-linux-7ddd4cd5c31ccaf32febe52462f9fdc915893212.zip
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: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 2c4bfdbae88f..28269f219e16 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -909,7 +909,7 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget,
trace_snd_soc_dapm_output_path(widget, path);
- if (path->sink && path->connect) {
+ if (path->connect) {
path->walked = 1;
path->walking = 1;
@@ -1017,7 +1017,7 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget,
trace_snd_soc_dapm_input_path(widget, path);
- if (path->source && path->connect) {
+ if (path->connect) {
path->walked = 1;
path->walking = 1;
@@ -1219,9 +1219,6 @@ static int dapm_supply_check_power(struct snd_soc_dapm_widget *w)
!path->connected(path->source, path->sink))
continue;
- if (!path->sink)
- continue;
-
if (dapm_widget_power_check(path->sink))
return 1;
}
@@ -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
* also.
*/
- list_for_each_entry(path, &w->sources, list_sink) {
- if (path->source) {
- dapm_widget_set_peer_power(path->source, power,
- path->connect);
- }
- }
+ list_for_each_entry(path, &w->sources, list_sink)
+ dapm_widget_set_peer_power(path->source, power, path->connect);
+
switch (w->id) {
case snd_soc_dapm_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,
/* Supplies can't affect their outputs, only their inputs */
break;
default:
- list_for_each_entry(path, &w->sinks, list_source) {
- if (path->sink) {
- dapm_widget_set_peer_power(path->sink, power,
- path->connect);
- }
- }
+ list_for_each_entry(path, &w->sinks, list_source)
+ dapm_widget_set_peer_power(path->sink, power,
+ path->connect);
break;
}