aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ac97/ac97_bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ac97/ac97_bus.c')
-rw-r--r--sound/pci/ac97/ac97_bus.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/sound/pci/ac97/ac97_bus.c b/sound/pci/ac97/ac97_bus.c
index 227f8b9f67ce..becbc420ba41 100644
--- a/sound/pci/ac97/ac97_bus.c
+++ b/sound/pci/ac97/ac97_bus.c
@@ -17,25 +17,21 @@
17#include <linux/string.h> 17#include <linux/string.h>
18 18
19/* 19/*
20 * Codec families have names seperated by commas, so we search for an 20 * Let drivers decide whether they want to support given codec from their
21 * individual codec name within the family string. 21 * probe method. Drivers have direct access to the ac97_t structure and may
22 * decide based on the id field amongst other things.
22 */ 23 */
23static int ac97_bus_match(struct device *dev, struct device_driver *drv) 24static int ac97_bus_match(struct device *dev, struct device_driver *drv)
24{ 25{
25 return (strstr(dev->bus_id, drv->name) != NULL); 26 return 1;
26} 27}
27 28
28static int ac97_bus_suspend(struct device *dev, pm_message_t state) 29static int ac97_bus_suspend(struct device *dev, pm_message_t state)
29{ 30{
30 int ret = 0; 31 int ret = 0;
31 32
32 if (dev->driver && dev->driver->suspend) { 33 if (dev->driver && dev->driver->suspend)
33 ret = dev->driver->suspend(dev, state, SUSPEND_DISABLE); 34 ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
34 if (ret == 0)
35 ret = dev->driver->suspend(dev, state, SUSPEND_SAVE_STATE);
36 if (ret == 0)
37 ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
38 }
39 return ret; 35 return ret;
40} 36}
41 37
@@ -43,13 +39,8 @@ static int ac97_bus_resume(struct device *dev)
43{ 39{
44 int ret = 0; 40 int ret = 0;
45 41
46 if (dev->driver && dev->driver->resume) { 42 if (dev->driver && dev->driver->resume)
47 ret = dev->driver->resume(dev, RESUME_POWER_ON); 43 ret = dev->driver->resume(dev, RESUME_POWER_ON);
48 if (ret == 0)
49 ret = dev->driver->resume(dev, RESUME_RESTORE_STATE);
50 if (ret == 0)
51 ret = dev->driver->resume(dev, RESUME_ENABLE);
52 }
53 return ret; 44 return ret;
54} 45}
55 46