diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-01-20 16:52:42 -0500 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-23 05:41:44 -0400 |
| commit | 939941d44dcaa138241d2182bd9e10f2b5d52665 (patch) | |
| tree | 10cff0c5fd1fe7d798b2f4ba145897cf65c4fa1f | |
| parent | 44be0a40d8666d9f3acee2a329e50f925e32d8b0 (diff) | |
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>
| -rw-r--r-- | drivers/mfd/pcf50633-core.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 501ce13b693e..2640e4dcd078 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/workqueue.h> | 21 | #include <linux/workqueue.h> |
| 22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
| 23 | #include <linux/i2c.h> | 23 | #include <linux/i2c.h> |
| 24 | #include <linux/pm.h> | ||
| 24 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
| 25 | 26 | ||
| 26 | #include <linux/mfd/pcf50633/core.h> | 27 | #include <linux/mfd/pcf50633/core.h> |
| @@ -230,27 +231,26 @@ pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name, | |||
| 230 | } | 231 | } |
| 231 | } | 232 | } |
| 232 | 233 | ||
| 233 | #ifdef CONFIG_PM | 234 | #ifdef CONFIG_PM_SLEEP |
| 234 | static int pcf50633_suspend(struct i2c_client *client, pm_message_t state) | 235 | static int pcf50633_suspend(struct device *dev) |
| 235 | { | 236 | { |
| 236 | struct pcf50633 *pcf; | 237 | struct i2c_client *client = to_i2c_client(dev); |
| 237 | pcf = i2c_get_clientdata(client); | 238 | struct pcf50633 *pcf = i2c_get_clientdata(client); |
| 238 | 239 | ||
| 239 | return pcf50633_irq_suspend(pcf); | 240 | return pcf50633_irq_suspend(pcf); |
| 240 | } | 241 | } |
| 241 | 242 | ||
| 242 | static int pcf50633_resume(struct i2c_client *client) | 243 | static int pcf50633_resume(struct device *dev) |
| 243 | { | 244 | { |
| 244 | struct pcf50633 *pcf; | 245 | struct i2c_client *client = to_i2c_client(dev); |
| 245 | pcf = i2c_get_clientdata(client); | 246 | struct pcf50633 *pcf = i2c_get_clientdata(client); |
| 246 | 247 | ||
| 247 | return pcf50633_irq_resume(pcf); | 248 | return pcf50633_irq_resume(pcf); |
| 248 | } | 249 | } |
| 249 | #else | ||
| 250 | #define pcf50633_suspend NULL | ||
| 251 | #define pcf50633_resume NULL | ||
| 252 | #endif | 250 | #endif |
| 253 | 251 | ||
| 252 | static SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume); | ||
| 253 | |||
| 254 | static int __devinit pcf50633_probe(struct i2c_client *client, | 254 | static int __devinit pcf50633_probe(struct i2c_client *client, |
| 255 | const struct i2c_device_id *ids) | 255 | const struct i2c_device_id *ids) |
| 256 | { | 256 | { |
| @@ -364,12 +364,11 @@ static struct i2c_device_id pcf50633_id_table[] = { | |||
| 364 | static struct i2c_driver pcf50633_driver = { | 364 | static struct i2c_driver pcf50633_driver = { |
| 365 | .driver = { | 365 | .driver = { |
| 366 | .name = "pcf50633", | 366 | .name = "pcf50633", |
| 367 | .pm = &pcf50633_pm, | ||
| 367 | }, | 368 | }, |
| 368 | .id_table = pcf50633_id_table, | 369 | .id_table = pcf50633_id_table, |
| 369 | .probe = pcf50633_probe, | 370 | .probe = pcf50633_probe, |
| 370 | .remove = __devexit_p(pcf50633_remove), | 371 | .remove = __devexit_p(pcf50633_remove), |
| 371 | .suspend = pcf50633_suspend, | ||
| 372 | .resume = pcf50633_resume, | ||
| 373 | }; | 372 | }; |
| 374 | 373 | ||
| 375 | static int __init pcf50633_init(void) | 374 | static int __init pcf50633_init(void) |
