mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
ce788f930b
commit
179eb03268
1 changed files with 7 additions and 1 deletions
|
@ -675,8 +675,14 @@ static int __init alarmtimer_init_late(void)
|
||||||
/* Find an rtc device and init the rtc_timer */
|
/* Find an rtc device and init the rtc_timer */
|
||||||
dev = class_find_device(rtc_class, NULL, &str, has_wakealarm);
|
dev = class_find_device(rtc_class, NULL, &str, has_wakealarm);
|
||||||
/* If we have a device then str is valid. See has_wakealarm() */
|
/* If we have a device then str is valid. See has_wakealarm() */
|
||||||
if (dev)
|
if (dev) {
|
||||||
rtcdev = rtc_class_open(str);
|
rtcdev = rtc_class_open(str);
|
||||||
|
/*
|
||||||
|
* Drop the reference we got in class_find_device,
|
||||||
|
* rtc_open takes its own.
|
||||||
|
*/
|
||||||
|
put_device(dev);
|
||||||
|
}
|
||||||
if (!rtcdev) {
|
if (!rtcdev) {
|
||||||
printk(KERN_WARNING "No RTC device found, ALARM timers will"
|
printk(KERN_WARNING "No RTC device found, ALARM timers will"
|
||||||
" not wake from suspend");
|
" not wake from suspend");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue