aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2010-06-08 15:07:13 +0200
committerLars-Peter Clausen <lars@metafoo.de>2010-06-08 15:37:32 +0200
commit687d09365fef8fe4bcabb909fe8a5e9a1b0834a2 (patch)
tree5eb866b77ae30e89a287792de2b6cdbb0dff25e3
parent4a29094bdf6ff382b7558e242ddb91c67fc200c7 (diff)
MFD: PCF50633: Use dev_pm_ops instead of legacy i2c suspend/resume callbacks
Right now in 2.6.34 the legacy powermanagement callbacks are broken, so we work around it by switching to dev_pm_ops.
-rw-r--r--drivers/mfd/pcf50633-core.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index dfb25583170..5082c829444 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -218,24 +218,30 @@ static struct attribute_group pcf_attr_group = {
};
#ifdef CONFIG_PM
-static int pcf50633_suspend(struct i2c_client *client, pm_message_t state)
+
+static int pcf50633_suspend(struct device *dev)
{
- struct pcf50633 *pcf;
- pcf = i2c_get_clientdata(client);
+ struct pcf50633 *pcf = dev_get_drvdata(dev);
return pcf50633_irq_suspend(pcf);
}
-static int pcf50633_resume(struct i2c_client *client)
+static int pcf50633_resume(struct device *dev)
{
- struct pcf50633 *pcf;
- pcf = i2c_get_clientdata(client);
+ struct pcf50633 *pcf = dev_get_drvdata(dev);
return pcf50633_irq_resume(pcf);
}
+
+static const struct dev_pm_ops pcf50633_pm_ops = {
+ .suspend = pcf50633_suspend,
+ .resume = pcf50633_resume,
+};
+
+#define PCF50633_PM_OPS (&pcf50633_pm_ops)
+
#else
-#define pcf50633_suspend NULL
-#define pcf50633_resume NULL
+#define PC50633_PM_OPS NULL
#endif
#define PCF50633_CELL(_name) \
@@ -351,12 +357,11 @@ static struct i2c_device_id pcf50633_id_table[] = {
static struct i2c_driver pcf50633_driver = {
.driver = {
.name = "pcf50633",
+ .pm = PCF50633_PM_OPS,
},
.id_table = pcf50633_id_table,
.probe = pcf50633_probe,
.remove = __devexit_p(pcf50633_remove),
- .suspend = pcf50633_suspend,
- .resume = pcf50633_resume,
};
static int __init pcf50633_init(void)