aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 10:00:01 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:20:28 -0500
commite26e7545e9542425f140cb4c605a7ab5a3b13e00 (patch)
treeadbbb875ffba2bf48f18aa962cb0d260314744a5 /sound
parent603bf524aa4cba95e4fcd64dbfffc41f804c65ab (diff)
[ALSA] ac97 - NULL check in snd_ac97_suspend/resume
Modules: AC97 Codec Add NULL check in snd_ac97_suspend() and snd_ac97_resume() so that the caller doesn't have to do it by itself. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/ac97/ac97_codec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 9faeaefc8e6e..abc83fa85bcd 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -2186,6 +2186,8 @@ static void snd_ac97_powerdown(struct snd_ac97 *ac97)
2186 */ 2186 */
2187void snd_ac97_suspend(struct snd_ac97 *ac97) 2187void snd_ac97_suspend(struct snd_ac97 *ac97)
2188{ 2188{
2189 if (! ac97)
2190 return;
2189 if (ac97->build_ops->suspend) 2191 if (ac97->build_ops->suspend)
2190 ac97->build_ops->suspend(ac97); 2192 ac97->build_ops->suspend(ac97);
2191 snd_ac97_powerdown(ac97); 2193 snd_ac97_powerdown(ac97);
@@ -2242,6 +2244,9 @@ void snd_ac97_resume(struct snd_ac97 *ac97)
2242{ 2244{
2243 unsigned long end_time; 2245 unsigned long end_time;
2244 2246
2247 if (! ac97)
2248 return;
2249
2245 if (ac97->bus->ops->reset) { 2250 if (ac97->bus->ops->reset) {
2246 ac97->bus->ops->reset(ac97); 2251 ac97->bus->ops->reset(ac97);
2247 goto __reset_ready; 2252 goto __reset_ready;