Commit b9f1b45b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Wolfram Sang

i2c-puv3: Use struct dev_pm_ops for power management

Make the PKUnity-v3 SoC I2C controller driver define its suspend
callback through a struct dev_pm_ops object rather than by using
a legacy PM hook in struct platform_driver.  The empty resume
callback is not necessary, so remove it.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarGuan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent 783414ba
...@@ -254,7 +254,7 @@ static int __devexit puv3_i2c_remove(struct platform_device *pdev) ...@@ -254,7 +254,7 @@ static int __devexit puv3_i2c_remove(struct platform_device *pdev)
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int puv3_i2c_suspend(struct platform_device *dev, pm_message_t state) static int puv3_i2c_suspend(struct device *dev)
{ {
int poll_count; int poll_count;
/* Disable the IIC */ /* Disable the IIC */
...@@ -267,23 +267,20 @@ static int puv3_i2c_suspend(struct platform_device *dev, pm_message_t state) ...@@ -267,23 +267,20 @@ static int puv3_i2c_suspend(struct platform_device *dev, pm_message_t state)
return 0; return 0;
} }
static int puv3_i2c_resume(struct platform_device *dev) static SIMPLE_DEV_PM_OPS(puv3_i2c_pm, puv3_i2c_suspend, NULL);
{ #define PUV3_I2C_PM (&puv3_i2c_pm)
return 0 ;
}
#else #else
#define puv3_i2c_suspend NULL #define PUV3_I2C_PM NULL
#define puv3_i2c_resume NULL
#endif #endif
static struct platform_driver puv3_i2c_driver = { static struct platform_driver puv3_i2c_driver = {
.probe = puv3_i2c_probe, .probe = puv3_i2c_probe,
.remove = __devexit_p(puv3_i2c_remove), .remove = __devexit_p(puv3_i2c_remove),
.suspend = puv3_i2c_suspend,
.resume = puv3_i2c_resume,
.driver = { .driver = {
.name = "PKUnity-v3-I2C", .name = "PKUnity-v3-I2C",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = PUV3_I2C_PM,
} }
}; };
......
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