diff options
| author | David Woodhouse <David.Woodhouse@intel.com> | 2012-10-09 10:03:21 -0400 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-10-09 10:04:25 -0400 |
| commit | ffe315012510165ce82e4dd4767f0a5dba9edbf7 (patch) | |
| tree | f601cd980af9d0ced5ca9aedecef4fa0d2ca0e15 /drivers/rtc/class.c | |
| parent | e2d3a35ee427aaba99b6c68a56609ce276c51270 (diff) | |
| parent | 4a8e43feeac7996b8de2d5b2823e316917493df4 (diff) | |
Merge tag 'disintegrate-mtd-20121009' of git://git.infradead.org/users/dhowells/linux-headers
UAPI Disintegration 2012-10-09
Conflicts:
MAINTAINERS
arch/arm/configs/bcmring_defconfig
arch/arm/mach-imx/clk-imx51-imx53.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/bcm_umi_nand.c
drivers/mtd/nand/nand_bcm_umi.h
drivers/mtd/nand/orion_nand.c
Diffstat (limited to 'drivers/rtc/class.c')
| -rw-r--r-- | drivers/rtc/class.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index dc4c2748bbc3..f8a0aab218cb 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
| @@ -31,8 +31,12 @@ static void rtc_device_release(struct device *dev) | |||
| 31 | kfree(rtc); | 31 | kfree(rtc); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | #if defined(CONFIG_PM) && defined(CONFIG_RTC_HCTOSYS_DEVICE) | 34 | #ifdef CONFIG_RTC_HCTOSYS_DEVICE |
| 35 | /* Result of the last RTC to system clock attempt. */ | ||
| 36 | int rtc_hctosys_ret = -ENODEV; | ||
| 37 | #endif | ||
| 35 | 38 | ||
| 39 | #if defined(CONFIG_PM) && defined(CONFIG_RTC_HCTOSYS_DEVICE) | ||
| 36 | /* | 40 | /* |
| 37 | * On suspend(), measure the delta between one RTC and the | 41 | * On suspend(), measure the delta between one RTC and the |
| 38 | * system's wall clock; restore it on resume(). | 42 | * system's wall clock; restore it on resume(). |
| @@ -84,6 +88,7 @@ static int rtc_resume(struct device *dev) | |||
| 84 | struct timespec new_system, new_rtc; | 88 | struct timespec new_system, new_rtc; |
| 85 | struct timespec sleep_time; | 89 | struct timespec sleep_time; |
| 86 | 90 | ||
| 91 | rtc_hctosys_ret = -ENODEV; | ||
| 87 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) | 92 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) |
| 88 | return 0; | 93 | return 0; |
| 89 | 94 | ||
| @@ -117,6 +122,7 @@ static int rtc_resume(struct device *dev) | |||
| 117 | 122 | ||
| 118 | if (sleep_time.tv_sec >= 0) | 123 | if (sleep_time.tv_sec >= 0) |
| 119 | timekeeping_inject_sleeptime(&sleep_time); | 124 | timekeeping_inject_sleeptime(&sleep_time); |
| 125 | rtc_hctosys_ret = 0; | ||
| 120 | return 0; | 126 | return 0; |
| 121 | } | 127 | } |
| 122 | 128 | ||
| @@ -238,6 +244,7 @@ void rtc_device_unregister(struct rtc_device *rtc) | |||
| 238 | rtc_proc_del_device(rtc); | 244 | rtc_proc_del_device(rtc); |
| 239 | device_unregister(&rtc->dev); | 245 | device_unregister(&rtc->dev); |
| 240 | rtc->ops = NULL; | 246 | rtc->ops = NULL; |
| 247 | ida_simple_remove(&rtc_ida, rtc->id); | ||
| 241 | mutex_unlock(&rtc->ops_lock); | 248 | mutex_unlock(&rtc->ops_lock); |
| 242 | put_device(&rtc->dev); | 249 | put_device(&rtc->dev); |
| 243 | } | 250 | } |
