diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:21:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:40 -0400 |
commit | ef69a7f061c822af72a53109920cf3128f1ad572 (patch) | |
tree | d5dcfa50b6145e91e3903f41198610c70bc47d0d /drivers/rtc/rtc-stmp3xxx.c | |
parent | b086e392b1d435f6abc1dab32b21ee5559cb53de (diff) |
rtc: rtc-stmp3xxx: convert stmp3xxx_rtcdrv to dev_pm_ops
Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-stmp3xxx.c')
-rw-r--r-- | drivers/rtc/rtc-stmp3xxx.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-stmp3xxx.c b/drivers/rtc/rtc-stmp3xxx.c index 0930f275b2dd..a9cd26a26dc0 100644 --- a/drivers/rtc/rtc-stmp3xxx.c +++ b/drivers/rtc/rtc-stmp3xxx.c | |||
@@ -297,15 +297,15 @@ out: | |||
297 | return err; | 297 | return err; |
298 | } | 298 | } |
299 | 299 | ||
300 | #ifdef CONFIG_PM | 300 | #ifdef CONFIG_PM_SLEEP |
301 | static int stmp3xxx_rtc_suspend(struct platform_device *dev, pm_message_t state) | 301 | static int stmp3xxx_rtc_suspend(struct device *dev) |
302 | { | 302 | { |
303 | return 0; | 303 | return 0; |
304 | } | 304 | } |
305 | 305 | ||
306 | static int stmp3xxx_rtc_resume(struct platform_device *dev) | 306 | static int stmp3xxx_rtc_resume(struct device *dev) |
307 | { | 307 | { |
308 | struct stmp3xxx_rtc_data *rtc_data = platform_get_drvdata(dev); | 308 | struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev); |
309 | 309 | ||
310 | mxs_reset_block(rtc_data->io); | 310 | mxs_reset_block(rtc_data->io); |
311 | writel(STMP3XXX_RTC_PERSISTENT0_ALARM_EN | | 311 | writel(STMP3XXX_RTC_PERSISTENT0_ALARM_EN | |
@@ -314,11 +314,11 @@ static int stmp3xxx_rtc_resume(struct platform_device *dev) | |||
314 | rtc_data->io + STMP3XXX_RTC_PERSISTENT0_CLR); | 314 | rtc_data->io + STMP3XXX_RTC_PERSISTENT0_CLR); |
315 | return 0; | 315 | return 0; |
316 | } | 316 | } |
317 | #else | ||
318 | #define stmp3xxx_rtc_suspend NULL | ||
319 | #define stmp3xxx_rtc_resume NULL | ||
320 | #endif | 317 | #endif |
321 | 318 | ||
319 | static SIMPLE_DEV_PM_OPS(stmp3xxx_rtc_pm_ops, stmp3xxx_rtc_suspend, | ||
320 | stmp3xxx_rtc_resume); | ||
321 | |||
322 | static const struct of_device_id rtc_dt_ids[] = { | 322 | static const struct of_device_id rtc_dt_ids[] = { |
323 | { .compatible = "fsl,stmp3xxx-rtc", }, | 323 | { .compatible = "fsl,stmp3xxx-rtc", }, |
324 | { /* sentinel */ } | 324 | { /* sentinel */ } |
@@ -328,11 +328,10 @@ MODULE_DEVICE_TABLE(of, rtc_dt_ids); | |||
328 | static struct platform_driver stmp3xxx_rtcdrv = { | 328 | static struct platform_driver stmp3xxx_rtcdrv = { |
329 | .probe = stmp3xxx_rtc_probe, | 329 | .probe = stmp3xxx_rtc_probe, |
330 | .remove = stmp3xxx_rtc_remove, | 330 | .remove = stmp3xxx_rtc_remove, |
331 | .suspend = stmp3xxx_rtc_suspend, | ||
332 | .resume = stmp3xxx_rtc_resume, | ||
333 | .driver = { | 331 | .driver = { |
334 | .name = "stmp3xxx-rtc", | 332 | .name = "stmp3xxx-rtc", |
335 | .owner = THIS_MODULE, | 333 | .owner = THIS_MODULE, |
334 | .pm = &stmp3xxx_rtc_pm_ops, | ||
336 | .of_match_table = of_match_ptr(rtc_dt_ids), | 335 | .of_match_table = of_match_ptr(rtc_dt_ids), |
337 | }, | 336 | }, |
338 | }; | 337 | }; |