diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-05-04 02:18:34 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-05-04 02:18:34 -0400 |
commit | 179eb03268aa1da03d90f1566ea85dc1478d3ae3 (patch) | |
tree | fda7d48258075bf84f12ce143ab7cd260bbc92e8 | |
parent | ce788f930b0cdf821de7ee8f84cfe8cf7fcb6311 (diff) |
alarmtimer: Drop device refcount after rtc_open()
class_find_device() takes a refcount on the rtc device. rtc_open()
takes another one, so we can drop it after the rtc_open() call.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
-rw-r--r-- | kernel/time/alarmtimer.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index e5db9b00751b..c6027fe9a4e6 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c | |||
@@ -675,8 +675,14 @@ static int __init alarmtimer_init_late(void) | |||
675 | /* Find an rtc device and init the rtc_timer */ | 675 | /* Find an rtc device and init the rtc_timer */ |
676 | dev = class_find_device(rtc_class, NULL, &str, has_wakealarm); | 676 | dev = class_find_device(rtc_class, NULL, &str, has_wakealarm); |
677 | /* If we have a device then str is valid. See has_wakealarm() */ | 677 | /* If we have a device then str is valid. See has_wakealarm() */ |
678 | if (dev) | 678 | if (dev) { |
679 | rtcdev = rtc_class_open(str); | 679 | rtcdev = rtc_class_open(str); |
680 | /* | ||
681 | * Drop the reference we got in class_find_device, | ||
682 | * rtc_open takes its own. | ||
683 | */ | ||
684 | put_device(dev); | ||
685 | } | ||
680 | if (!rtcdev) { | 686 | if (!rtcdev) { |
681 | printk(KERN_WARNING "No RTC device found, ALARM timers will" | 687 | printk(KERN_WARNING "No RTC device found, ALARM timers will" |
682 | " not wake from suspend"); | 688 | " not wake from suspend"); |