diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-06-07 08:57:17 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-06-08 08:52:06 -0400 |
commit | 291f3bbcacf278726911c713e14cedb71c486b16 (patch) | |
tree | a4da4e2b27638e81404a6dbb771dca303d0cd596 | |
parent | 4f1c1923851f9734c972812121e80a3b04ab3af4 (diff) |
ASoC: Make DAPM power sequence lists local variables
They are now only accessed within dapm_power_widgets() so can be local
to that function.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | include/sound/soc.h | 2 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 19 |
2 files changed, 8 insertions, 13 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index cf6111d72b17..5964dd65bbd3 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -369,8 +369,6 @@ struct snd_soc_codec { | |||
369 | enum snd_soc_bias_level bias_level; | 369 | enum snd_soc_bias_level bias_level; |
370 | enum snd_soc_bias_level suspend_bias_level; | 370 | enum snd_soc_bias_level suspend_bias_level; |
371 | struct delayed_work delayed_work; | 371 | struct delayed_work delayed_work; |
372 | struct list_head up_list; | ||
373 | struct list_head down_list; | ||
374 | 372 | ||
375 | /* codec DAI's */ | 373 | /* codec DAI's */ |
376 | struct snd_soc_dai *dai; | 374 | struct snd_soc_dai *dai; |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 7299ce405b2d..1c30da1535b5 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -927,23 +927,22 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) | |||
927 | { | 927 | { |
928 | struct snd_soc_device *socdev = codec->socdev; | 928 | struct snd_soc_device *socdev = codec->socdev; |
929 | struct snd_soc_dapm_widget *w; | 929 | struct snd_soc_dapm_widget *w; |
930 | LIST_HEAD(up_list); | ||
931 | LIST_HEAD(down_list); | ||
930 | int ret = 0; | 932 | int ret = 0; |
931 | int power; | 933 | int power; |
932 | int sys_power = 0; | 934 | int sys_power = 0; |
933 | 935 | ||
934 | INIT_LIST_HEAD(&codec->up_list); | ||
935 | INIT_LIST_HEAD(&codec->down_list); | ||
936 | |||
937 | /* Check which widgets we need to power and store them in | 936 | /* Check which widgets we need to power and store them in |
938 | * lists indicating if they should be powered up or down. | 937 | * lists indicating if they should be powered up or down. |
939 | */ | 938 | */ |
940 | list_for_each_entry(w, &codec->dapm_widgets, list) { | 939 | list_for_each_entry(w, &codec->dapm_widgets, list) { |
941 | switch (w->id) { | 940 | switch (w->id) { |
942 | case snd_soc_dapm_pre: | 941 | case snd_soc_dapm_pre: |
943 | dapm_seq_insert(w, &codec->down_list, dapm_down_seq); | 942 | dapm_seq_insert(w, &down_list, dapm_down_seq); |
944 | break; | 943 | break; |
945 | case snd_soc_dapm_post: | 944 | case snd_soc_dapm_post: |
946 | dapm_seq_insert(w, &codec->up_list, dapm_up_seq); | 945 | dapm_seq_insert(w, &up_list, dapm_up_seq); |
947 | break; | 946 | break; |
948 | 947 | ||
949 | default: | 948 | default: |
@@ -958,11 +957,9 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) | |||
958 | continue; | 957 | continue; |
959 | 958 | ||
960 | if (power) | 959 | if (power) |
961 | dapm_seq_insert(w, &codec->up_list, | 960 | dapm_seq_insert(w, &up_list, dapm_up_seq); |
962 | dapm_up_seq); | ||
963 | else | 961 | else |
964 | dapm_seq_insert(w, &codec->down_list, | 962 | dapm_seq_insert(w, &down_list, dapm_down_seq); |
965 | dapm_down_seq); | ||
966 | 963 | ||
967 | w->power = power; | 964 | w->power = power; |
968 | break; | 965 | break; |
@@ -979,10 +976,10 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event) | |||
979 | } | 976 | } |
980 | 977 | ||
981 | /* Power down widgets first; try to avoid amplifying pops. */ | 978 | /* Power down widgets first; try to avoid amplifying pops. */ |
982 | dapm_seq_run(codec, &codec->down_list, event, dapm_down_seq); | 979 | dapm_seq_run(codec, &down_list, event, dapm_down_seq); |
983 | 980 | ||
984 | /* Now power up. */ | 981 | /* Now power up. */ |
985 | dapm_seq_run(codec, &codec->up_list, event, dapm_up_seq); | 982 | dapm_seq_run(codec, &up_list, event, dapm_up_seq); |
986 | 983 | ||
987 | /* If we just powered the last thing off drop to standby bias */ | 984 | /* If we just powered the last thing off drop to standby bias */ |
988 | if (codec->bias_level == SND_SOC_BIAS_PREPARE && !sys_power) { | 985 | if (codec->bias_level == SND_SOC_BIAS_PREPARE && !sys_power) { |