| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * kernel/power/suspend_test.c - Suspend to RAM and standby test facility. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2009 Pavel Machek <pavel@ucw.cz> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This file is released under the GPLv2. |
|---|
| 7 | 6 | */ |
|---|
| 8 | 7 | |
|---|
| 9 | 8 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 71 | 70 | static char info_test[] __initdata = |
|---|
| 72 | 71 | KERN_INFO "PM: test RTC wakeup from '%s' suspend\n"; |
|---|
| 73 | 72 | |
|---|
| 74 | | - unsigned long now; |
|---|
| 73 | + time64_t now; |
|---|
| 75 | 74 | struct rtc_wkalrm alm; |
|---|
| 76 | 75 | int status; |
|---|
| 77 | 76 | |
|---|
| .. | .. |
|---|
| 82 | 81 | printk(err_readtime, dev_name(&rtc->dev), status); |
|---|
| 83 | 82 | return; |
|---|
| 84 | 83 | } |
|---|
| 85 | | - rtc_tm_to_time(&alm.time, &now); |
|---|
| 84 | + now = rtc_tm_to_time64(&alm.time); |
|---|
| 86 | 85 | |
|---|
| 87 | 86 | memset(&alm, 0, sizeof alm); |
|---|
| 88 | | - rtc_time_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time); |
|---|
| 87 | + rtc_time64_to_tm(now + TEST_SUSPEND_SECONDS, &alm.time); |
|---|
| 89 | 88 | alm.enabled = true; |
|---|
| 90 | 89 | |
|---|
| 91 | 90 | status = rtc_set_alarm(rtc, &alm); |
|---|
| .. | .. |
|---|
| 158 | 157 | value++; |
|---|
| 159 | 158 | suspend_type = strsep(&value, ","); |
|---|
| 160 | 159 | if (!suspend_type) |
|---|
| 161 | | - return 0; |
|---|
| 160 | + return 1; |
|---|
| 162 | 161 | |
|---|
| 163 | 162 | repeat = strsep(&value, ","); |
|---|
| 164 | 163 | if (repeat) { |
|---|
| 165 | 164 | if (kstrtou32(repeat, 0, &test_repeat_count_max)) |
|---|
| 166 | | - return 0; |
|---|
| 165 | + return 1; |
|---|
| 167 | 166 | } |
|---|
| 168 | 167 | |
|---|
| 169 | 168 | for (i = PM_SUSPEND_MIN; i < PM_SUSPEND_MAX; i++) |
|---|
| 170 | 169 | if (!strcmp(pm_labels[i], suspend_type)) { |
|---|
| 171 | 170 | test_state_label = pm_labels[i]; |
|---|
| 172 | | - return 0; |
|---|
| 171 | + return 1; |
|---|
| 173 | 172 | } |
|---|
| 174 | 173 | |
|---|
| 175 | 174 | printk(warn_bad_state, suspend_type); |
|---|
| 176 | | - return 0; |
|---|
| 175 | + return 1; |
|---|
| 177 | 176 | } |
|---|
| 178 | 177 | __setup("test_suspend", setup_test_suspend); |
|---|
| 179 | 178 | |
|---|