]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Revert "rtc_sysfs_show_hctosys(): display 0 if resume failed"
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 14 Sep 2012 07:09:11 +0000 (17:09 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 14 Sep 2012 07:09:11 +0000 (17:09 +1000)
This reverts commit 0311ece6c39c0a0befd6db99ef7d36f5af28c4c2.

drivers/rtc/class.c
drivers/rtc/hctosys.c
drivers/rtc/rtc-sysfs.c
include/linux/rtc.h

index 6d5b12095ec042ade51445d7d4952bcac6fd5a37..37b1d82fda085551b2823b01e984cee03c4d6d24 100644 (file)
@@ -39,8 +39,7 @@ static void rtc_device_release(struct device *dev)
  */
 
 static struct timespec old_rtc, old_system, old_delta;
-/* Result of the last RTC to system clock attempt. */
-int rtc_hctosys_ret = -ENODEV;
+
 
 static int rtc_suspend(struct device *dev, pm_message_t mesg)
 {
@@ -85,7 +84,6 @@ static int rtc_resume(struct device *dev)
        struct timespec         new_system, new_rtc;
        struct timespec         sleep_time;
 
-       rtc_hctosys_ret = -ENODEV;
        if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
                return 0;
 
@@ -119,7 +117,6 @@ static int rtc_resume(struct device *dev)
 
        if (sleep_time.tv_sec >= 0)
                timekeeping_inject_sleeptime(&sleep_time);
-       rtc_hctosys_ret = 0;
        return 0;
 }
 
index 4aa60d74004e41ffdd7be050728f9cf63a7fa48c..bc90b091f1954faecf087f2094c6094e31606da2 100644 (file)
@@ -22,6 +22,8 @@
  * the best guess is to add 0.5s.
  */
 
+int rtc_hctosys_ret = -ENODEV;
+
 static int __init rtc_hctosys(void)
 {
        int err = -ENODEV;
@@ -54,7 +56,7 @@ static int __init rtc_hctosys(void)
 
        rtc_tm_to_time(&tm, &tv.tv_sec);
 
-       err = do_settimeofday(&tv);
+       do_settimeofday(&tv);
 
        dev_info(rtc->dev.parent,
                "setting system clock to "
index b70e2bb6364500fb7d02c2dffb6c01575e1771e4..380083ca572fd480ba0f060c2f9ead3925d855a4 100644 (file)
@@ -102,12 +102,6 @@ rtc_sysfs_set_max_user_freq(struct device *dev, struct device_attribute *attr,
        return n;
 }
 
-/**
- * rtc_sysfs_show_hctosys - indicate if the given RTC set the system time
- *
- * Returns 1 if the system clock was set by this RTC at the last
- * boot or resume event.
- */
 static ssize_t
 rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
                char *buf)
index 20ec4d3bed733d3818f4bb7f899b0322b253372e..f071b3922c67f7a253c0b5f978b4bec1b7a690df 100644 (file)
@@ -276,7 +276,7 @@ static inline bool is_leap_year(unsigned int year)
        return (!(year % 4) && (year % 100)) || !(year % 400);
 }
 
-#ifdef CONFIG_RTC_HCTOSYS_DEVICE
+#ifdef CONFIG_RTC_HCTOSYS
 extern int rtc_hctosys_ret;
 #else
 #define rtc_hctosys_ret -ENODEV