Commit 87d1906d authored by Mark Brown's avatar Mark Brown Committed by Samuel Ortiz

mfd: Convert WM831x SPI to use dev_pm_ops

There is a move to deprecate bus-specific PM operations and move to
using dev_pm_ops instead in order to reduce the amount of boilerplate
code in buses and facilitiate updates to the PM core. Do this move for
the WM831x SPI driver.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 6f9f13bf
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pm.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/mfd/wm831x/core.h> #include <linux/mfd/wm831x/core.h>
...@@ -113,22 +114,27 @@ static int __devexit wm831x_spi_remove(struct spi_device *spi) ...@@ -113,22 +114,27 @@ static int __devexit wm831x_spi_remove(struct spi_device *spi)
return 0; return 0;
} }
static int wm831x_spi_suspend(struct spi_device *spi, pm_message_t m) static int wm831x_spi_suspend(struct device *dev)
{ {
struct wm831x *wm831x = dev_get_drvdata(&spi->dev); struct wm831x *wm831x = dev_get_drvdata(dev);
return wm831x_device_suspend(wm831x); return wm831x_device_suspend(wm831x);
} }
static const struct dev_pm_ops wm831x_spi_pm = {
.freeze = wm831x_spi_suspend,
.suspend = wm831x_spi_suspend,
};
static struct spi_driver wm8310_spi_driver = { static struct spi_driver wm8310_spi_driver = {
.driver = { .driver = {
.name = "wm8310", .name = "wm8310",
.bus = &spi_bus_type, .bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &wm831x_spi_pm,
}, },
.probe = wm831x_spi_probe, .probe = wm831x_spi_probe,
.remove = __devexit_p(wm831x_spi_remove), .remove = __devexit_p(wm831x_spi_remove),
.suspend = wm831x_spi_suspend,
}; };
static struct spi_driver wm8311_spi_driver = { static struct spi_driver wm8311_spi_driver = {
...@@ -136,10 +142,10 @@ static struct spi_driver wm8311_spi_driver = { ...@@ -136,10 +142,10 @@ static struct spi_driver wm8311_spi_driver = {
.name = "wm8311", .name = "wm8311",
.bus = &spi_bus_type, .bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &wm831x_spi_pm,
}, },
.probe = wm831x_spi_probe, .probe = wm831x_spi_probe,
.remove = __devexit_p(wm831x_spi_remove), .remove = __devexit_p(wm831x_spi_remove),
.suspend = wm831x_spi_suspend,
}; };
static struct spi_driver wm8312_spi_driver = { static struct spi_driver wm8312_spi_driver = {
...@@ -147,10 +153,10 @@ static struct spi_driver wm8312_spi_driver = { ...@@ -147,10 +153,10 @@ static struct spi_driver wm8312_spi_driver = {
.name = "wm8312", .name = "wm8312",
.bus = &spi_bus_type, .bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &wm831x_spi_pm,
}, },
.probe = wm831x_spi_probe, .probe = wm831x_spi_probe,
.remove = __devexit_p(wm831x_spi_remove), .remove = __devexit_p(wm831x_spi_remove),
.suspend = wm831x_spi_suspend,
}; };
static struct spi_driver wm8320_spi_driver = { static struct spi_driver wm8320_spi_driver = {
...@@ -158,10 +164,10 @@ static struct spi_driver wm8320_spi_driver = { ...@@ -158,10 +164,10 @@ static struct spi_driver wm8320_spi_driver = {
.name = "wm8320", .name = "wm8320",
.bus = &spi_bus_type, .bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &wm831x_spi_pm,
}, },
.probe = wm831x_spi_probe, .probe = wm831x_spi_probe,
.remove = __devexit_p(wm831x_spi_remove), .remove = __devexit_p(wm831x_spi_remove),
.suspend = wm831x_spi_suspend,
}; };
static struct spi_driver wm8321_spi_driver = { static struct spi_driver wm8321_spi_driver = {
...@@ -169,10 +175,10 @@ static struct spi_driver wm8321_spi_driver = { ...@@ -169,10 +175,10 @@ static struct spi_driver wm8321_spi_driver = {
.name = "wm8321", .name = "wm8321",
.bus = &spi_bus_type, .bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &wm831x_spi_pm,
}, },
.probe = wm831x_spi_probe, .probe = wm831x_spi_probe,
.remove = __devexit_p(wm831x_spi_remove), .remove = __devexit_p(wm831x_spi_remove),
.suspend = wm831x_spi_suspend,
}; };
static struct spi_driver wm8325_spi_driver = { static struct spi_driver wm8325_spi_driver = {
...@@ -180,10 +186,10 @@ static struct spi_driver wm8325_spi_driver = { ...@@ -180,10 +186,10 @@ static struct spi_driver wm8325_spi_driver = {
.name = "wm8325", .name = "wm8325",
.bus = &spi_bus_type, .bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &wm831x_spi_pm,
}, },
.probe = wm831x_spi_probe, .probe = wm831x_spi_probe,
.remove = __devexit_p(wm831x_spi_remove), .remove = __devexit_p(wm831x_spi_remove),
.suspend = wm831x_spi_suspend,
}; };
static struct spi_driver wm8326_spi_driver = { static struct spi_driver wm8326_spi_driver = {
...@@ -191,10 +197,10 @@ static struct spi_driver wm8326_spi_driver = { ...@@ -191,10 +197,10 @@ static struct spi_driver wm8326_spi_driver = {
.name = "wm8326", .name = "wm8326",
.bus = &spi_bus_type, .bus = &spi_bus_type,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &wm831x_spi_pm,
}, },
.probe = wm831x_spi_probe, .probe = wm831x_spi_probe,
.remove = __devexit_p(wm831x_spi_remove), .remove = __devexit_p(wm831x_spi_remove),
.suspend = wm831x_spi_suspend,
}; };
static int __init wm831x_spi_init(void) static int __init wm831x_spi_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment