aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-cmos.c16
-rw-r--r--drivers/rtc/rtc-rs5c372.c2
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 5856167a0c90..dd8242d489b8 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -36,6 +36,7 @@
36#include <linux/platform_device.h> 36#include <linux/platform_device.h>
37#include <linux/mod_devicetable.h> 37#include <linux/mod_devicetable.h>
38#include <linux/log2.h> 38#include <linux/log2.h>
39#include <linux/pm.h>
39 40
40/* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ 41/* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */
41#include <asm-generic/rtc.h> 42#include <asm-generic/rtc.h>
@@ -850,7 +851,7 @@ static void __exit cmos_do_remove(struct device *dev)
850 851
851#ifdef CONFIG_PM 852#ifdef CONFIG_PM
852 853
853static int cmos_suspend(struct device *dev, pm_message_t mesg) 854static int cmos_suspend(struct device *dev)
854{ 855{
855 struct cmos_rtc *cmos = dev_get_drvdata(dev); 856 struct cmos_rtc *cmos = dev_get_drvdata(dev);
856 unsigned char tmp; 857 unsigned char tmp;
@@ -898,7 +899,7 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg)
898 */ 899 */
899static inline int cmos_poweroff(struct device *dev) 900static inline int cmos_poweroff(struct device *dev)
900{ 901{
901 return cmos_suspend(dev, PMSG_HIBERNATE); 902 return cmos_suspend(dev);
902} 903}
903 904
904static int cmos_resume(struct device *dev) 905static int cmos_resume(struct device *dev)
@@ -945,9 +946,9 @@ static int cmos_resume(struct device *dev)
945 return 0; 946 return 0;
946} 947}
947 948
949static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume);
950
948#else 951#else
949#define cmos_suspend NULL
950#define cmos_resume NULL
951 952
952static inline int cmos_poweroff(struct device *dev) 953static inline int cmos_poweroff(struct device *dev)
953{ 954{
@@ -1077,7 +1078,7 @@ static void __exit cmos_pnp_remove(struct pnp_dev *pnp)
1077 1078
1078static int cmos_pnp_suspend(struct pnp_dev *pnp, pm_message_t mesg) 1079static int cmos_pnp_suspend(struct pnp_dev *pnp, pm_message_t mesg)
1079{ 1080{
1080 return cmos_suspend(&pnp->dev, mesg); 1081 return cmos_suspend(&pnp->dev);
1081} 1082}
1082 1083
1083static int cmos_pnp_resume(struct pnp_dev *pnp) 1084static int cmos_pnp_resume(struct pnp_dev *pnp)
@@ -1157,8 +1158,9 @@ static struct platform_driver cmos_platform_driver = {
1157 .shutdown = cmos_platform_shutdown, 1158 .shutdown = cmos_platform_shutdown,
1158 .driver = { 1159 .driver = {
1159 .name = (char *) driver_name, 1160 .name = (char *) driver_name,
1160 .suspend = cmos_suspend, 1161#ifdef CONFIG_PM
1161 .resume = cmos_resume, 1162 .pm = &cmos_pm_ops,
1163#endif
1162 } 1164 }
1163}; 1165};
1164 1166
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index 90cf0a6ff23e..dd14e202c2c8 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -207,7 +207,7 @@ static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *tm)
207static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm) 207static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm)
208{ 208{
209 struct rs5c372 *rs5c = i2c_get_clientdata(client); 209 struct rs5c372 *rs5c = i2c_get_clientdata(client);
210 unsigned char buf[8]; 210 unsigned char buf[7];
211 int addr; 211 int addr;
212 212
213 dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d " 213 dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d "