aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
authorJon Hunter <jon-hunter@ti.com>2013-04-01 15:33:50 -0400
committerJon Hunter <jon-hunter@ti.com>2013-04-01 15:33:50 -0400
commitdca3a783400a18e2bf4503b1d4a85c4d0ca1a7e4 (patch)
treea3689b801070c1360b120b7280c6adc4de5f692a /drivers/rtc/class.c
parent71856843fb1d8ee455a4c1a60696c74afa4809e5 (diff)
parent31d9adca82ce65e5c99d045b5fd917c702b6fce3 (diff)
Merge commit '31d9adca82ce65e5c99d045b5fd917c702b6fce3' into tmp
Conflicts: arch/arm/plat-omap/dmtimer.c
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r--drivers/rtc/class.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 5143629dedbd..9b742d3ffb94 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -11,6 +11,8 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15
14#include <linux/module.h> 16#include <linux/module.h>
15#include <linux/rtc.h> 17#include <linux/rtc.h>
16#include <linux/kdev_t.h> 18#include <linux/kdev_t.h>
@@ -50,6 +52,10 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
50 struct rtc_device *rtc = to_rtc_device(dev); 52 struct rtc_device *rtc = to_rtc_device(dev);
51 struct rtc_time tm; 53 struct rtc_time tm;
52 struct timespec delta, delta_delta; 54 struct timespec delta, delta_delta;
55
56 if (has_persistent_clock())
57 return 0;
58
53 if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) 59 if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
54 return 0; 60 return 0;
55 61
@@ -88,6 +94,9 @@ static int rtc_resume(struct device *dev)
88 struct timespec new_system, new_rtc; 94 struct timespec new_system, new_rtc;
89 struct timespec sleep_time; 95 struct timespec sleep_time;
90 96
97 if (has_persistent_clock())
98 return 0;
99
91 rtc_hctosys_ret = -ENODEV; 100 rtc_hctosys_ret = -ENODEV;
92 if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) 101 if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
93 return 0; 102 return 0;
@@ -254,7 +263,7 @@ static int __init rtc_init(void)
254{ 263{
255 rtc_class = class_create(THIS_MODULE, "rtc"); 264 rtc_class = class_create(THIS_MODULE, "rtc");
256 if (IS_ERR(rtc_class)) { 265 if (IS_ERR(rtc_class)) {
257 printk(KERN_ERR "%s: couldn't create class\n", __FILE__); 266 pr_err("couldn't create class\n");
258 return PTR_ERR(rtc_class); 267 return PTR_ERR(rtc_class);
259 } 268 }
260 rtc_class->suspend = rtc_suspend; 269 rtc_class->suspend = rtc_suspend;