From 687d09365fef8fe4bcabb909fe8a5e9a1b0834a2 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 8 Jun 2010 15:07:13 +0200 Subject: 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. --- drivers/mfd/pcf50633-core.c | 25 +++++++++++++++---------- 1 file 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) -- cgit v1.2.3