diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-11 15:25:55 -0400 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-07-12 06:04:54 -0400 |
commit | b9f1b45bacb6485838e0504c312ecabc90c1e273 (patch) | |
tree | 86a23238390f18f476f97ae0ce6ed008bd9e5b55 | |
parent | 783414ba9a65fa15e44716dc478e9536d202e0ff (diff) |
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: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
-rw-r--r-- | drivers/i2c/busses/i2c-puv3.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-puv3.c b/drivers/i2c/busses/i2c-puv3.c index 93709fbe30eb..d8515be00b98 100644 --- a/drivers/i2c/busses/i2c-puv3.c +++ b/drivers/i2c/busses/i2c-puv3.c | |||
@@ -254,7 +254,7 @@ static int __devexit puv3_i2c_remove(struct platform_device *pdev) | |||
254 | } | 254 | } |
255 | 255 | ||
256 | #ifdef CONFIG_PM | 256 | #ifdef CONFIG_PM |
257 | static int puv3_i2c_suspend(struct platform_device *dev, pm_message_t state) | 257 | static int puv3_i2c_suspend(struct device *dev) |
258 | { | 258 | { |
259 | int poll_count; | 259 | int poll_count; |
260 | /* Disable the IIC */ | 260 | /* Disable the IIC */ |
@@ -267,23 +267,20 @@ static int puv3_i2c_suspend(struct platform_device *dev, pm_message_t state) | |||
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | 269 | ||
270 | static int puv3_i2c_resume(struct platform_device *dev) | 270 | static SIMPLE_DEV_PM_OPS(puv3_i2c_pm, puv3_i2c_suspend, NULL); |
271 | { | 271 | #define PUV3_I2C_PM (&puv3_i2c_pm) |
272 | return 0 ; | 272 | |
273 | } | ||
274 | #else | 273 | #else |
275 | #define puv3_i2c_suspend NULL | 274 | #define PUV3_I2C_PM NULL |
276 | #define puv3_i2c_resume NULL | ||
277 | #endif | 275 | #endif |
278 | 276 | ||
279 | static struct platform_driver puv3_i2c_driver = { | 277 | static struct platform_driver puv3_i2c_driver = { |
280 | .probe = puv3_i2c_probe, | 278 | .probe = puv3_i2c_probe, |
281 | .remove = __devexit_p(puv3_i2c_remove), | 279 | .remove = __devexit_p(puv3_i2c_remove), |
282 | .suspend = puv3_i2c_suspend, | ||
283 | .resume = puv3_i2c_resume, | ||
284 | .driver = { | 280 | .driver = { |
285 | .name = "PKUnity-v3-I2C", | 281 | .name = "PKUnity-v3-I2C", |
286 | .owner = THIS_MODULE, | 282 | .owner = THIS_MODULE, |
283 | .pm = PUV3_I2C_PM, | ||
287 | } | 284 | } |
288 | }; | 285 | }; |
289 | 286 | ||