diff options
Diffstat (limited to 'arch/i386/kernel/apm.c')
-rw-r--r-- | arch/i386/kernel/apm.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index f9ba0af7ee1f..064bbf2861f4 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -236,7 +236,6 @@ | |||
236 | 236 | ||
237 | #include "io_ports.h" | 237 | #include "io_ports.h" |
238 | 238 | ||
239 | extern unsigned long get_cmos_time(void); | ||
240 | extern void machine_real_restart(unsigned char *, int); | 239 | extern void machine_real_restart(unsigned char *, int); |
241 | 240 | ||
242 | #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) | 241 | #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) |
@@ -1176,28 +1175,6 @@ out: | |||
1176 | spin_unlock(&user_list_lock); | 1175 | spin_unlock(&user_list_lock); |
1177 | } | 1176 | } |
1178 | 1177 | ||
1179 | static void set_time(void) | ||
1180 | { | ||
1181 | struct timespec ts; | ||
1182 | if (got_clock_diff) { /* Must know time zone in order to set clock */ | ||
1183 | ts.tv_sec = get_cmos_time() + clock_cmos_diff; | ||
1184 | ts.tv_nsec = 0; | ||
1185 | do_settimeofday(&ts); | ||
1186 | } | ||
1187 | } | ||
1188 | |||
1189 | static void get_time_diff(void) | ||
1190 | { | ||
1191 | #ifndef CONFIG_APM_RTC_IS_GMT | ||
1192 | /* | ||
1193 | * Estimate time zone so that set_time can update the clock | ||
1194 | */ | ||
1195 | clock_cmos_diff = -get_cmos_time(); | ||
1196 | clock_cmos_diff += get_seconds(); | ||
1197 | got_clock_diff = 1; | ||
1198 | #endif | ||
1199 | } | ||
1200 | |||
1201 | static void reinit_timer(void) | 1178 | static void reinit_timer(void) |
1202 | { | 1179 | { |
1203 | #ifdef INIT_TIMER_AFTER_SUSPEND | 1180 | #ifdef INIT_TIMER_AFTER_SUSPEND |
@@ -1237,19 +1214,6 @@ static int suspend(int vetoable) | |||
1237 | local_irq_disable(); | 1214 | local_irq_disable(); |
1238 | device_power_down(PMSG_SUSPEND); | 1215 | device_power_down(PMSG_SUSPEND); |
1239 | 1216 | ||
1240 | /* serialize with the timer interrupt */ | ||
1241 | write_seqlock(&xtime_lock); | ||
1242 | |||
1243 | /* protect against access to timer chip registers */ | ||
1244 | spin_lock(&i8253_lock); | ||
1245 | |||
1246 | get_time_diff(); | ||
1247 | /* | ||
1248 | * Irq spinlock must be dropped around set_system_power_state. | ||
1249 | * We'll undo any timer changes due to interrupts below. | ||
1250 | */ | ||
1251 | spin_unlock(&i8253_lock); | ||
1252 | write_sequnlock(&xtime_lock); | ||
1253 | local_irq_enable(); | 1217 | local_irq_enable(); |
1254 | 1218 | ||
1255 | save_processor_state(); | 1219 | save_processor_state(); |
@@ -1258,7 +1222,6 @@ static int suspend(int vetoable) | |||
1258 | restore_processor_state(); | 1222 | restore_processor_state(); |
1259 | 1223 | ||
1260 | local_irq_disable(); | 1224 | local_irq_disable(); |
1261 | set_time(); | ||
1262 | reinit_timer(); | 1225 | reinit_timer(); |
1263 | 1226 | ||
1264 | if (err == APM_NO_ERROR) | 1227 | if (err == APM_NO_ERROR) |
@@ -1288,11 +1251,6 @@ static void standby(void) | |||
1288 | 1251 | ||
1289 | local_irq_disable(); | 1252 | local_irq_disable(); |
1290 | device_power_down(PMSG_SUSPEND); | 1253 | device_power_down(PMSG_SUSPEND); |
1291 | /* serialize with the timer interrupt */ | ||
1292 | write_seqlock(&xtime_lock); | ||
1293 | /* If needed, notify drivers here */ | ||
1294 | get_time_diff(); | ||
1295 | write_sequnlock(&xtime_lock); | ||
1296 | local_irq_enable(); | 1254 | local_irq_enable(); |
1297 | 1255 | ||
1298 | err = set_system_power_state(APM_STATE_STANDBY); | 1256 | err = set_system_power_state(APM_STATE_STANDBY); |
@@ -1386,7 +1344,6 @@ static void check_events(void) | |||
1386 | ignore_bounce = 1; | 1344 | ignore_bounce = 1; |
1387 | if ((event != APM_NORMAL_RESUME) | 1345 | if ((event != APM_NORMAL_RESUME) |
1388 | || (ignore_normal_resume == 0)) { | 1346 | || (ignore_normal_resume == 0)) { |
1389 | set_time(); | ||
1390 | device_resume(); | 1347 | device_resume(); |
1391 | pm_send_all(PM_RESUME, (void *)0); | 1348 | pm_send_all(PM_RESUME, (void *)0); |
1392 | queue_event(event, NULL); | 1349 | queue_event(event, NULL); |
@@ -1402,7 +1359,6 @@ static void check_events(void) | |||
1402 | break; | 1359 | break; |
1403 | 1360 | ||
1404 | case APM_UPDATE_TIME: | 1361 | case APM_UPDATE_TIME: |
1405 | set_time(); | ||
1406 | break; | 1362 | break; |
1407 | 1363 | ||
1408 | case APM_CRITICAL_SUSPEND: | 1364 | case APM_CRITICAL_SUSPEND: |