File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 13
13
#include <linux/export.h>
14
14
#include <linux/rtc.h>
15
15
#include <linux/suspend.h>
16
+ #include <linux/init.h>
16
17
17
18
#include <linux/mc146818rtc.h>
18
19
@@ -165,6 +166,9 @@ void generate_pm_trace(const void *tracedata, unsigned int user)
165
166
const char * file = * (const char * * )(tracedata + 2 );
166
167
unsigned int user_hash_value , file_hash_value ;
167
168
169
+ if (!x86_platform .legacy .rtc )
170
+ return ;
171
+
168
172
user_hash_value = user % USERHASH ;
169
173
file_hash_value = hash_string (lineno , file , FILEHASH );
170
174
set_magic_time (user_hash_value , file_hash_value , dev_hash_value );
@@ -267,6 +271,9 @@ static struct notifier_block pm_trace_nb = {
267
271
268
272
static int __init early_resume_init (void )
269
273
{
274
+ if (!x86_platform .legacy .rtc )
275
+ return 0 ;
276
+
270
277
hash_value_early_read = read_magic_time ();
271
278
register_pm_notifier (& pm_trace_nb );
272
279
return 0 ;
@@ -277,6 +284,9 @@ static int __init late_resume_init(void)
277
284
unsigned int val = hash_value_early_read ;
278
285
unsigned int user , file , dev ;
279
286
287
+ if (!x86_platform .legacy .rtc )
288
+ return 0 ;
289
+
280
290
user = val % USERHASH ;
281
291
val = val / USERHASH ;
282
292
file = val % FILEHASH ;
You can’t perform that action at this time.
0 commit comments