mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
mfd: Convert pcf50633 to 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 pcf50633 driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
44be0a40d8
commit
939941d44d
1 changed files with 11 additions and 12 deletions
|
@ -21,6 +21,7 @@
|
||||||
#include <linux/workqueue.h>
|
#include <linux/workqueue.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/i2c.h>
|
#include <linux/i2c.h>
|
||||||
|
#include <linux/pm.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#include <linux/mfd/pcf50633/core.h>
|
#include <linux/mfd/pcf50633/core.h>
|
||||||
|
@ -230,27 +231,26 @@ pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int pcf50633_suspend(struct i2c_client *client, pm_message_t state)
|
static int pcf50633_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct pcf50633 *pcf;
|
struct i2c_client *client = to_i2c_client(dev);
|
||||||
pcf = i2c_get_clientdata(client);
|
struct pcf50633 *pcf = i2c_get_clientdata(client);
|
||||||
|
|
||||||
return pcf50633_irq_suspend(pcf);
|
return pcf50633_irq_suspend(pcf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pcf50633_resume(struct i2c_client *client)
|
static int pcf50633_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct pcf50633 *pcf;
|
struct i2c_client *client = to_i2c_client(dev);
|
||||||
pcf = i2c_get_clientdata(client);
|
struct pcf50633 *pcf = i2c_get_clientdata(client);
|
||||||
|
|
||||||
return pcf50633_irq_resume(pcf);
|
return pcf50633_irq_resume(pcf);
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define pcf50633_suspend NULL
|
|
||||||
#define pcf50633_resume NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume);
|
||||||
|
|
||||||
static int __devinit pcf50633_probe(struct i2c_client *client,
|
static int __devinit pcf50633_probe(struct i2c_client *client,
|
||||||
const struct i2c_device_id *ids)
|
const struct i2c_device_id *ids)
|
||||||
{
|
{
|
||||||
|
@ -364,12 +364,11 @@ static struct i2c_device_id pcf50633_id_table[] = {
|
||||||
static struct i2c_driver pcf50633_driver = {
|
static struct i2c_driver pcf50633_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "pcf50633",
|
.name = "pcf50633",
|
||||||
|
.pm = &pcf50633_pm,
|
||||||
},
|
},
|
||||||
.id_table = pcf50633_id_table,
|
.id_table = pcf50633_id_table,
|
||||||
.probe = pcf50633_probe,
|
.probe = pcf50633_probe,
|
||||||
.remove = __devexit_p(pcf50633_remove),
|
.remove = __devexit_p(pcf50633_remove),
|
||||||
.suspend = pcf50633_suspend,
|
|
||||||
.resume = pcf50633_resume,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init pcf50633_init(void)
|
static int __init pcf50633_init(void)
|
||||||
|
|
Loading…
Reference in a new issue