diff options
Diffstat (limited to 'sound/pci/echoaudio/echoaudio.c')
-rw-r--r-- | sound/pci/echoaudio/echoaudio.c | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 595c11f904bb..0ff754f180d0 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c | |||
@@ -2205,9 +2205,10 @@ ctl_error: | |||
2205 | 2205 | ||
2206 | #if defined(CONFIG_PM) | 2206 | #if defined(CONFIG_PM) |
2207 | 2207 | ||
2208 | static int snd_echo_suspend(struct pci_dev *pci, pm_message_t state) | 2208 | static int snd_echo_suspend(struct device *dev) |
2209 | { | 2209 | { |
2210 | struct echoaudio *chip = pci_get_drvdata(pci); | 2210 | struct pci_dev *pci = to_pci_dev(dev); |
2211 | struct echoaudio *chip = dev_get_drvdata(dev); | ||
2211 | 2212 | ||
2212 | DE_INIT(("suspend start\n")); | 2213 | DE_INIT(("suspend start\n")); |
2213 | snd_pcm_suspend_all(chip->analog_pcm); | 2214 | snd_pcm_suspend_all(chip->analog_pcm); |
@@ -2242,9 +2243,10 @@ static int snd_echo_suspend(struct pci_dev *pci, pm_message_t state) | |||
2242 | 2243 | ||
2243 | 2244 | ||
2244 | 2245 | ||
2245 | static int snd_echo_resume(struct pci_dev *pci) | 2246 | static int snd_echo_resume(struct device *dev) |
2246 | { | 2247 | { |
2247 | struct echoaudio *chip = pci_get_drvdata(pci); | 2248 | struct pci_dev *pci = to_pci_dev(dev); |
2249 | struct echoaudio *chip = dev_get_drvdata(dev); | ||
2248 | struct comm_page *commpage, *commpage_bak; | 2250 | struct comm_page *commpage, *commpage_bak; |
2249 | u32 pipe_alloc_mask; | 2251 | u32 pipe_alloc_mask; |
2250 | int err; | 2252 | int err; |
@@ -2307,10 +2309,13 @@ static int snd_echo_resume(struct pci_dev *pci) | |||
2307 | return 0; | 2309 | return 0; |
2308 | } | 2310 | } |
2309 | 2311 | ||
2312 | static SIMPLE_DEV_PM_OPS(snd_echo_pm, snd_echo_suspend, snd_echo_resume); | ||
2313 | #define SND_ECHO_PM_OPS &snd_echo_pm | ||
2314 | #else | ||
2315 | #define SND_ECHO_PM_OPS NULL | ||
2310 | #endif /* CONFIG_PM */ | 2316 | #endif /* CONFIG_PM */ |
2311 | 2317 | ||
2312 | 2318 | ||
2313 | |||
2314 | static void __devexit snd_echo_remove(struct pci_dev *pci) | 2319 | static void __devexit snd_echo_remove(struct pci_dev *pci) |
2315 | { | 2320 | { |
2316 | struct echoaudio *chip; | 2321 | struct echoaudio *chip; |
@@ -2328,33 +2333,14 @@ static void __devexit snd_echo_remove(struct pci_dev *pci) | |||
2328 | ******************************************************************************/ | 2333 | ******************************************************************************/ |
2329 | 2334 | ||
2330 | /* pci_driver definition */ | 2335 | /* pci_driver definition */ |
2331 | static struct pci_driver driver = { | 2336 | static struct pci_driver echo_driver = { |
2332 | .name = KBUILD_MODNAME, | 2337 | .name = KBUILD_MODNAME, |
2333 | .id_table = snd_echo_ids, | 2338 | .id_table = snd_echo_ids, |
2334 | .probe = snd_echo_probe, | 2339 | .probe = snd_echo_probe, |
2335 | .remove = __devexit_p(snd_echo_remove), | 2340 | .remove = __devexit_p(snd_echo_remove), |
2336 | #ifdef CONFIG_PM | 2341 | .driver = { |
2337 | .suspend = snd_echo_suspend, | 2342 | .pm = SND_ECHO_PM_OPS, |
2338 | .resume = snd_echo_resume, | 2343 | }, |
2339 | #endif /* CONFIG_PM */ | ||
2340 | }; | 2344 | }; |
2341 | 2345 | ||
2342 | 2346 | module_pci_driver(echo_driver); | |
2343 | |||
2344 | /* initialization of the module */ | ||
2345 | static int __init alsa_card_echo_init(void) | ||
2346 | { | ||
2347 | return pci_register_driver(&driver); | ||
2348 | } | ||
2349 | |||
2350 | |||
2351 | |||
2352 | /* clean up the module */ | ||
2353 | static void __exit alsa_card_echo_exit(void) | ||
2354 | { | ||
2355 | pci_unregister_driver(&driver); | ||
2356 | } | ||
2357 | |||
2358 | |||
2359 | module_init(alsa_card_echo_init) | ||
2360 | module_exit(alsa_card_echo_exit) | ||