aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-01-31 08:34:38 -0500
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:03:28 -0500
commit3b6baa5a0b0a2877c18a76fa1f508cacdbc08edf (patch)
tree93d41b6ec1dfba7c2ffcb65185d6768a5497acc6 /sound
parent965ac42ce919db225ee64678f0be02f2fdf5b5e4 (diff)
[ALSA] Remove delayed work properly at free and suspend
Remove delayed work properly at free and suspend in ac97 codec and ak4114 drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/i2c/other/ak4114.c3
-rw-r--r--sound/pci/ac97/ac97_codec.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c
index 34bbafc81cf6..d2b17c83fd33 100644
--- a/sound/i2c/other/ak4114.c
+++ b/sound/i2c/other/ak4114.c
@@ -66,6 +66,7 @@ static void snd_ak4114_free(struct ak4114 *chip)
66{ 66{
67 chip->init = 1; /* don't schedule new work */ 67 chip->init = 1; /* don't schedule new work */
68 mb(); 68 mb();
69 cancel_delayed_work(&chip->work);
69 flush_scheduled_work(); 70 flush_scheduled_work();
70 kfree(chip); 71 kfree(chip);
71} 72}
@@ -97,6 +98,7 @@ int snd_ak4114_create(struct snd_card *card,
97 chip->read = read; 98 chip->read = read;
98 chip->write = write; 99 chip->write = write;
99 chip->private_data = private_data; 100 chip->private_data = private_data;
101 INIT_DELAYED_WORK(&chip->work, ak4114_stats);
100 102
101 for (reg = 0; reg < 7; reg++) 103 for (reg = 0; reg < 7; reg++)
102 chip->regmap[reg] = pgm[reg]; 104 chip->regmap[reg] = pgm[reg];
@@ -149,7 +151,6 @@ void snd_ak4114_reinit(struct ak4114 *chip)
149 reg_write(chip, AK4114_REG_PWRDN, old | AK4114_RST | AK4114_PWN); 151 reg_write(chip, AK4114_REG_PWRDN, old | AK4114_RST | AK4114_PWN);
150 /* bring up statistics / event queing */ 152 /* bring up statistics / event queing */
151 chip->init = 0; 153 chip->init = 0;
152 INIT_DELAYED_WORK(&chip->work, ak4114_stats);
153 schedule_delayed_work(&chip->work, HZ / 10); 154 schedule_delayed_work(&chip->work, HZ / 10);
154} 155}
155 156
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 8b7853c14b5b..74ed81081478 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -990,6 +990,7 @@ static int snd_ac97_free(struct snd_ac97 *ac97)
990 if (ac97) { 990 if (ac97) {
991#ifdef CONFIG_SND_AC97_POWER_SAVE 991#ifdef CONFIG_SND_AC97_POWER_SAVE
992 cancel_delayed_work(&ac97->power_work); 992 cancel_delayed_work(&ac97->power_work);
993 flush_scheduled_work();
993#endif 994#endif
994 snd_ac97_proc_done(ac97); 995 snd_ac97_proc_done(ac97);
995 if (ac97->bus) 996 if (ac97->bus)
@@ -2415,6 +2416,10 @@ void snd_ac97_suspend(struct snd_ac97 *ac97)
2415 return; 2416 return;
2416 if (ac97->build_ops->suspend) 2417 if (ac97->build_ops->suspend)
2417 ac97->build_ops->suspend(ac97); 2418 ac97->build_ops->suspend(ac97);
2419#ifdef CONFIG_SND_AC97_POWER_SAVE
2420 cancel_delayed_work(&ac97->power_work);
2421 flush_scheduled_work();
2422#endif
2418 snd_ac97_powerdown(ac97); 2423 snd_ac97_powerdown(ac97);
2419} 2424}
2420 2425