aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/echoaudio/echoaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/echoaudio/echoaudio.c')
-rw-r--r--sound/pci/echoaudio/echoaudio.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 0f8eda1dafdb..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
2208static int snd_echo_suspend(struct pci_dev *pci, pm_message_t state) 2208static 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
2245static int snd_echo_resume(struct pci_dev *pci) 2246static 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
2312static 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
2314static void __devexit snd_echo_remove(struct pci_dev *pci) 2319static void __devexit snd_echo_remove(struct pci_dev *pci)
2315{ 2320{
2316 struct echoaudio *chip; 2321 struct echoaudio *chip;
@@ -2333,10 +2338,9 @@ static struct pci_driver echo_driver = {
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
2342module_pci_driver(echo_driver); 2346module_pci_driver(echo_driver);