Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b84ba26 authored by Tejun Heo's avatar Tejun Heo Committed by Takashi Iwai
Browse files

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: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent cf7d7e5a
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -287,10 +287,9 @@ static void ftr_gpio_exit(struct gpio_runtime *rt)
		free_irq(linein_detect_irq, &rt->line_in_notify);
	if (rt->line_out_notify.gpio_private)
		free_irq(lineout_detect_irq, &rt->line_out_notify);
	cancel_delayed_work(&rt->headphone_notify.work);
	cancel_delayed_work(&rt->line_in_notify.work);
	cancel_delayed_work(&rt->line_out_notify.work);
	flush_scheduled_work();
	cancel_delayed_work_sync(&rt->headphone_notify.work);
	cancel_delayed_work_sync(&rt->line_in_notify.work);
	cancel_delayed_work_sync(&rt->line_out_notify.work);
	mutex_destroy(&rt->headphone_notify.mutex);
	mutex_destroy(&rt->line_in_notify.mutex);
	mutex_destroy(&rt->line_out_notify.mutex);
+3 −4
Original line number Diff line number Diff line
@@ -107,10 +107,9 @@ static void pmf_gpio_exit(struct gpio_runtime *rt)

	/* make sure no work is pending before freeing
	 * all things */
	cancel_delayed_work(&rt->headphone_notify.work);
	cancel_delayed_work(&rt->line_in_notify.work);
	cancel_delayed_work(&rt->line_out_notify.work);
	flush_scheduled_work();
	cancel_delayed_work_sync(&rt->headphone_notify.work);
	cancel_delayed_work_sync(&rt->line_in_notify.work);
	cancel_delayed_work_sync(&rt->line_out_notify.work);

	mutex_destroy(&rt->headphone_notify.mutex);
	mutex_destroy(&rt->line_in_notify.mutex);
+2 −3
Original line number Diff line number Diff line
@@ -57,8 +57,7 @@ static void snd_ak4113_free(struct ak4113 *chip)
{
	chip->init = 1;	/* don't schedule new work */
	mb();
	cancel_delayed_work(&chip->work);
	flush_scheduled_work();
	cancel_delayed_work_sync(&chip->work);
	kfree(chip);
}

@@ -141,7 +140,7 @@ void snd_ak4113_reinit(struct ak4113 *chip)
{
	chip->init = 1;
	mb();
	flush_scheduled_work();
	flush_delayed_work_sync(&chip->work);
	ak4113_init_regs(chip);
	/* bring up statistics / event queing */
	chip->init = 0;
+2 −3
Original line number Diff line number Diff line
@@ -67,8 +67,7 @@ static void snd_ak4114_free(struct ak4114 *chip)
{
	chip->init = 1;	/* don't schedule new work */
	mb();
	cancel_delayed_work(&chip->work);
	flush_scheduled_work();
	cancel_delayed_work_sync(&chip->work);
	kfree(chip);
}

@@ -154,7 +153,7 @@ void snd_ak4114_reinit(struct ak4114 *chip)
{
	chip->init = 1;
	mb();
	flush_scheduled_work();
	flush_delayed_work_sync(&chip->work);
	ak4114_init_regs(chip);
	/* bring up statistics / event queing */
	chip->init = 0;
+2 −4
Original line number Diff line number Diff line
@@ -1014,8 +1014,7 @@ static int snd_ac97_free(struct snd_ac97 *ac97)
{
	if (ac97) {
#ifdef CONFIG_SND_AC97_POWER_SAVE
		cancel_delayed_work(&ac97->power_work);
		flush_scheduled_work();
		cancel_delayed_work_sync(&ac97->power_work);
#endif
		snd_ac97_proc_done(ac97);
		if (ac97->bus)
@@ -2456,8 +2455,7 @@ void snd_ac97_suspend(struct snd_ac97 *ac97)
	if (ac97->build_ops->suspend)
		ac97->build_ops->suspend(ac97);
#ifdef CONFIG_SND_AC97_POWER_SAVE
	cancel_delayed_work(&ac97->power_work);
	flush_scheduled_work();
	cancel_delayed_work_sync(&ac97->power_work);
#endif
	snd_ac97_powerdown(ac97);
}
Loading