diff options
author | Alexey Starikovskiy <astarikovskiy@suse.de> | 2007-09-30 14:39:36 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-10-10 01:00:26 -0400 |
commit | d30dc9abb4aacfd4df3f486f22bcbc0531b73283 (patch) | |
tree | cb2d69e1b5fc00ad7a6691f362e814ddd6af61fa /drivers/acpi/hardware/hwsleep.c | |
parent | bbf25010f1a6b761914430f5fca081ec8c7accd1 (diff) |
ACPICA: hw: remove use_lock flag from acpi_hw_register_{read, write}
use_lock flag is used once for acpi_hw_register_read, and never for
acpi_hw_register_write. It will greatly simplify understanding of
locking if we just drop this use_lock altogether, and wrap the only call
to ..._read in lock/unlock.
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/hardware/hwsleep.c')
-rw-r--r-- | drivers/acpi/hardware/hwsleep.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index cf69c0040a39..4d0c677fac19 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c | |||
@@ -313,8 +313,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
313 | 313 | ||
314 | /* Get current value of PM1A control */ | 314 | /* Get current value of PM1A control */ |
315 | 315 | ||
316 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 316 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol); |
317 | ACPI_REGISTER_PM1_CONTROL, &PM1Acontrol); | ||
318 | if (ACPI_FAILURE(status)) { | 317 | if (ACPI_FAILURE(status)) { |
319 | return_ACPI_STATUS(status); | 318 | return_ACPI_STATUS(status); |
320 | } | 319 | } |
@@ -341,15 +340,13 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
341 | 340 | ||
342 | /* Write #1: fill in SLP_TYP data */ | 341 | /* Write #1: fill in SLP_TYP data */ |
343 | 342 | ||
344 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 343 | status = acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
345 | ACPI_REGISTER_PM1A_CONTROL, | ||
346 | PM1Acontrol); | 344 | PM1Acontrol); |
347 | if (ACPI_FAILURE(status)) { | 345 | if (ACPI_FAILURE(status)) { |
348 | return_ACPI_STATUS(status); | 346 | return_ACPI_STATUS(status); |
349 | } | 347 | } |
350 | 348 | ||
351 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 349 | status = acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
352 | ACPI_REGISTER_PM1B_CONTROL, | ||
353 | PM1Bcontrol); | 350 | PM1Bcontrol); |
354 | if (ACPI_FAILURE(status)) { | 351 | if (ACPI_FAILURE(status)) { |
355 | return_ACPI_STATUS(status); | 352 | return_ACPI_STATUS(status); |
@@ -364,15 +361,13 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
364 | 361 | ||
365 | ACPI_FLUSH_CPU_CACHE(); | 362 | ACPI_FLUSH_CPU_CACHE(); |
366 | 363 | ||
367 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 364 | status = acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
368 | ACPI_REGISTER_PM1A_CONTROL, | ||
369 | PM1Acontrol); | 365 | PM1Acontrol); |
370 | if (ACPI_FAILURE(status)) { | 366 | if (ACPI_FAILURE(status)) { |
371 | return_ACPI_STATUS(status); | 367 | return_ACPI_STATUS(status); |
372 | } | 368 | } |
373 | 369 | ||
374 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 370 | status = acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
375 | ACPI_REGISTER_PM1B_CONTROL, | ||
376 | PM1Bcontrol); | 371 | PM1Bcontrol); |
377 | if (ACPI_FAILURE(status)) { | 372 | if (ACPI_FAILURE(status)) { |
378 | return_ACPI_STATUS(status); | 373 | return_ACPI_STATUS(status); |
@@ -392,8 +387,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) | |||
392 | */ | 387 | */ |
393 | acpi_os_stall(10000000); | 388 | acpi_os_stall(10000000); |
394 | 389 | ||
395 | status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 390 | status = acpi_hw_register_write(ACPI_REGISTER_PM1_CONTROL, |
396 | ACPI_REGISTER_PM1_CONTROL, | ||
397 | sleep_enable_reg_info-> | 391 | sleep_enable_reg_info-> |
398 | access_bit_mask); | 392 | access_bit_mask); |
399 | if (ACPI_FAILURE(status)) { | 393 | if (ACPI_FAILURE(status)) { |
@@ -520,8 +514,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
520 | 514 | ||
521 | /* Get current value of PM1A control */ | 515 | /* Get current value of PM1A control */ |
522 | 516 | ||
523 | status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, | 517 | status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL, |
524 | ACPI_REGISTER_PM1_CONTROL, | ||
525 | &PM1Acontrol); | 518 | &PM1Acontrol); |
526 | if (ACPI_SUCCESS(status)) { | 519 | if (ACPI_SUCCESS(status)) { |
527 | 520 | ||
@@ -543,11 +536,9 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
543 | 536 | ||
544 | /* Just ignore any errors */ | 537 | /* Just ignore any errors */ |
545 | 538 | ||
546 | (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 539 | (void)acpi_hw_register_write(ACPI_REGISTER_PM1A_CONTROL, |
547 | ACPI_REGISTER_PM1A_CONTROL, | ||
548 | PM1Acontrol); | 540 | PM1Acontrol); |
549 | (void)acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, | 541 | (void)acpi_hw_register_write(ACPI_REGISTER_PM1B_CONTROL, |
550 | ACPI_REGISTER_PM1B_CONTROL, | ||
551 | PM1Bcontrol); | 542 | PM1Bcontrol); |
552 | } | 543 | } |
553 | } | 544 | } |