| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * drivers/base/power/trace.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Trace facility for suspend/resume problems, when none of the |
|---|
| 7 | 8 | * devices may be working. |
|---|
| 8 | 9 | */ |
|---|
| 10 | +#define pr_fmt(fmt) "PM: " fmt |
|---|
| 9 | 11 | |
|---|
| 10 | 12 | #include <linux/pm-trace.h> |
|---|
| 11 | 13 | #include <linux/export.h> |
|---|
| .. | .. |
|---|
| 118 | 120 | struct rtc_time time; |
|---|
| 119 | 121 | unsigned int val; |
|---|
| 120 | 122 | |
|---|
| 121 | | - mc146818_get_time(&time); |
|---|
| 122 | | - pr_info("RTC time: %2d:%02d:%02d, date: %02d/%02d/%02d\n", |
|---|
| 123 | | - time.tm_hour, time.tm_min, time.tm_sec, |
|---|
| 124 | | - time.tm_mon + 1, time.tm_mday, time.tm_year % 100); |
|---|
| 123 | + if (mc146818_get_time(&time) < 0) { |
|---|
| 124 | + pr_err("Unable to read current time from RTC\n"); |
|---|
| 125 | + return 0; |
|---|
| 126 | + } |
|---|
| 127 | + |
|---|
| 128 | + pr_info("RTC time: %ptRt, date: %ptRd\n", &time, &time); |
|---|
| 125 | 129 | val = time.tm_year; /* 100 years */ |
|---|
| 126 | 130 | if (val > 100) |
|---|
| 127 | 131 | val -= 100; |
|---|
| .. | .. |
|---|
| 269 | 273 | .notifier_call = pm_trace_notify, |
|---|
| 270 | 274 | }; |
|---|
| 271 | 275 | |
|---|
| 272 | | -static int early_resume_init(void) |
|---|
| 276 | +static int __init early_resume_init(void) |
|---|
| 273 | 277 | { |
|---|
| 274 | 278 | if (!x86_platform.legacy.rtc) |
|---|
| 275 | 279 | return 0; |
|---|
| .. | .. |
|---|
| 279 | 283 | return 0; |
|---|
| 280 | 284 | } |
|---|
| 281 | 285 | |
|---|
| 282 | | -static int late_resume_init(void) |
|---|
| 286 | +static int __init late_resume_init(void) |
|---|
| 283 | 287 | { |
|---|
| 284 | 288 | unsigned int val = hash_value_early_read; |
|---|
| 285 | 289 | unsigned int user, file, dev; |
|---|