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/codecs | |
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/codecs')
-rw-r--r-- | sound/soc/codecs/wm8350.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/wm8753.c | 21 |
2 files changed, 2 insertions, 28 deletions
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index 7611add7f8c3..b3e9fac172e5 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c | |||
@@ -1626,7 +1626,6 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) | |||
1626 | { | 1626 | { |
1627 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); | 1627 | struct wm8350_data *priv = snd_soc_codec_get_drvdata(codec); |
1628 | struct wm8350 *wm8350 = dev_get_platdata(codec->dev); | 1628 | struct wm8350 *wm8350 = dev_get_platdata(codec->dev); |
1629 | int ret; | ||
1630 | 1629 | ||
1631 | wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, | 1630 | wm8350_clear_bits(wm8350, WM8350_JACK_DETECT, |
1632 | WM8350_JDL_ENA | WM8350_JDR_ENA); | 1631 | WM8350_JDL_ENA | WM8350_JDR_ENA); |
@@ -1641,15 +1640,9 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec) | |||
1641 | priv->hpr.jack = NULL; | 1640 | priv->hpr.jack = NULL; |
1642 | priv->mic.jack = NULL; | 1641 | priv->mic.jack = NULL; |
1643 | 1642 | ||
1644 | /* cancel any work waiting to be queued. */ | ||
1645 | ret = cancel_delayed_work(&codec->delayed_work); | ||
1646 | |||
1647 | /* if there was any work waiting then we run it now and | 1643 | /* if there was any work waiting then we run it now and |
1648 | * wait for its completion */ | 1644 | * wait for its completion */ |
1649 | if (ret) { | 1645 | flush_delayed_work_sync(&codec->delayed_work); |
1650 | schedule_delayed_work(&codec->delayed_work, 0); | ||
1651 | flush_scheduled_work(); | ||
1652 | } | ||
1653 | 1646 | ||
1654 | wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1647 | wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1655 | 1648 | ||
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 8f679a13f2bc..84a23675cba9 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1526,25 +1526,6 @@ static int wm8753_resume(struct snd_soc_codec *codec) | |||
1526 | return 0; | 1526 | return 0; |
1527 | } | 1527 | } |
1528 | 1528 | ||
1529 | /* | ||
1530 | * This function forces any delayed work to be queued and run. | ||
1531 | */ | ||
1532 | static int run_delayed_work(struct delayed_work *dwork) | ||
1533 | { | ||
1534 | int ret; | ||
1535 | |||
1536 | /* cancel any work waiting to be queued. */ | ||
1537 | ret = cancel_delayed_work(dwork); | ||
1538 | |||
1539 | /* if there was any work waiting then we run it now and | ||
1540 | * wait for it's completion */ | ||
1541 | if (ret) { | ||
1542 | schedule_delayed_work(dwork, 0); | ||
1543 | flush_scheduled_work(); | ||
1544 | } | ||
1545 | return ret; | ||
1546 | } | ||
1547 | |||
1548 | static int wm8753_probe(struct snd_soc_codec *codec) | 1529 | static int wm8753_probe(struct snd_soc_codec *codec) |
1549 | { | 1530 | { |
1550 | struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); | 1531 | struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); |
@@ -1604,7 +1585,7 @@ static int wm8753_probe(struct snd_soc_codec *codec) | |||
1604 | /* power down chip */ | 1585 | /* power down chip */ |
1605 | static int wm8753_remove(struct snd_soc_codec *codec) | 1586 | static int wm8753_remove(struct snd_soc_codec *codec) |
1606 | { | 1587 | { |
1607 | run_delayed_work(&codec->delayed_work); | 1588 | flush_delayed_work_sync(&codec->delayed_work); |
1608 | wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); | 1589 | wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF); |
1609 | 1590 | ||
1610 | return 0; | 1591 | return 0; |