@@ -732,8 +732,8 @@ static int wm97xx_remove(struct device *dev)
return 0;
}
-#ifdef CONFIG_PM
-static int wm97xx_suspend(struct device *dev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int wm97xx_suspend(struct device *dev)
{
struct wm97xx *wm = dev_get_drvdata(dev);
u16 reg;
@@ -799,9 +799,11 @@ static int wm97xx_resume(struct device *dev)
return 0;
}
+static SIMPLE_DEV_PM_OPS(wm97xx_pm_ops, wm97xx_suspend, wm97xx_resume);
+#define WM97XX_PM_OPS (&wm97xx_pm_ops)
+
#else
-#define wm97xx_suspend NULL
-#define wm97xx_resume NULL
+#define WM97XX_PM_OPS NULL
#endif
/*
@@ -836,8 +838,7 @@ static struct device_driver wm97xx_driver = {
.owner = THIS_MODULE,
.probe = wm97xx_probe,
.remove = wm97xx_remove,
- .suspend = wm97xx_suspend,
- .resume = wm97xx_resume,
+ .pm = WM97XX_PM_OPS,
};
static int __init wm97xx_init(void)
@@ -89,35 +89,9 @@ static int ac97_bus_match(struct device *dev, struct device_driver *drv)
return 1;
}
-#ifdef CONFIG_PM
-static int ac97_bus_suspend(struct device *dev, pm_message_t state)
-{
- int ret = 0;
-
- if (dev->driver && dev->driver->suspend)
- ret = dev->driver->suspend(dev, state);
-
- return ret;
-}
-
-static int ac97_bus_resume(struct device *dev)
-{
- int ret = 0;
-
- if (dev->driver && dev->driver->resume)
- ret = dev->driver->resume(dev);
-
- return ret;
-}
-#endif /* CONFIG_PM */
-
struct bus_type ac97_bus_type = {
.name = "ac97",
.match = ac97_bus_match,
-#ifdef CONFIG_PM
- .suspend = ac97_bus_suspend,
- .resume = ac97_bus_resume,
-#endif /* CONFIG_PM */
};
static int __init ac97_bus_init(void)