diff options
author | Tejun Heo <tj@kernel.org> | 2010-12-11 11:51:26 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-12-13 03:22:44 -0500 |
commit | 5b84ba26a9672e615897234fa5efd3eea2d6b295 (patch) | |
tree | 1d86d5179cefecc986b6c7be0550050c29418869 /sound/soc/soc-core.c | |
parent | cf7d7e5a1980d1116ee152d25dac382b112b9c17 (diff) |
sound: don't use flush_scheduled_work()
flush_scheduled_work() is deprecated and scheduled to be removed.
* cancel[_delayed]_work() + flush_scheduled_work() ->
cancel[_delayed]_work_sync().
* wm8350, wm8753 and soc-core use custom code to cancel a delayed
work, execute it immediately if it was pending and wait for its
completion. This is equivalent to flush_delayed_work_sync(). Use
it instead.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 441285ade024..b54ea9a0a1db 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -67,25 +67,6 @@ static int pmdown_time = 5000; | |||
67 | module_param(pmdown_time, int, 0); | 67 | module_param(pmdown_time, int, 0); |
68 | MODULE_PARM_DESC(pmdown_time, "DAPM stream powerdown time (msecs)"); | 68 | MODULE_PARM_DESC(pmdown_time, "DAPM stream powerdown time (msecs)"); |
69 | 69 | ||
70 | /* | ||
71 | * This function forces any delayed work to be queued and run. | ||
72 | */ | ||
73 | static int run_delayed_work(struct delayed_work *dwork) | ||
74 | { | ||
75 | int ret; | ||
76 | |||
77 | /* cancel any work waiting to be queued. */ | ||
78 | ret = cancel_delayed_work(dwork); | ||
79 | |||
80 | /* if there was any work waiting then we run it now and | ||
81 | * wait for it's completion */ | ||
82 | if (ret) { | ||
83 | schedule_delayed_work(dwork, 0); | ||
84 | flush_scheduled_work(); | ||
85 | } | ||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | /* codec register dump */ | 70 | /* codec register dump */ |
90 | static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf) | 71 | static ssize_t soc_codec_reg_show(struct snd_soc_codec *codec, char *buf) |
91 | { | 72 | { |
@@ -1016,7 +997,7 @@ static int soc_suspend(struct device *dev) | |||
1016 | 997 | ||
1017 | /* close any waiting streams and save state */ | 998 | /* close any waiting streams and save state */ |
1018 | for (i = 0; i < card->num_rtd; i++) { | 999 | for (i = 0; i < card->num_rtd; i++) { |
1019 | run_delayed_work(&card->rtd[i].delayed_work); | 1000 | flush_delayed_work_sync(&card->rtd[i].delayed_work); |
1020 | card->rtd[i].codec->suspend_bias_level = card->rtd[i].codec->bias_level; | 1001 | card->rtd[i].codec->suspend_bias_level = card->rtd[i].codec->bias_level; |
1021 | } | 1002 | } |
1022 | 1003 | ||
@@ -1687,7 +1668,7 @@ static int soc_remove(struct platform_device *pdev) | |||
1687 | /* make sure any delayed work runs */ | 1668 | /* make sure any delayed work runs */ |
1688 | for (i = 0; i < card->num_rtd; i++) { | 1669 | for (i = 0; i < card->num_rtd; i++) { |
1689 | struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; | 1670 | struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; |
1690 | run_delayed_work(&rtd->delayed_work); | 1671 | flush_delayed_work_sync(&rtd->delayed_work); |
1691 | } | 1672 | } |
1692 | 1673 | ||
1693 | /* remove and free each DAI */ | 1674 | /* remove and free each DAI */ |
@@ -1718,7 +1699,7 @@ static int soc_poweroff(struct device *dev) | |||
1718 | * now, we're shutting down so no imminent restart. */ | 1699 | * now, we're shutting down so no imminent restart. */ |
1719 | for (i = 0; i < card->num_rtd; i++) { | 1700 | for (i = 0; i < card->num_rtd; i++) { |
1720 | struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; | 1701 | struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; |
1721 | run_delayed_work(&rtd->delayed_work); | 1702 | flush_delayed_work_sync(&rtd->delayed_work); |
1722 | } | 1703 | } |
1723 | 1704 | ||
1724 | snd_soc_dapm_shutdown(card); | 1705 | snd_soc_dapm_shutdown(card); |