@@ -356,18 +356,19 @@ void acpi_device_power_remove_dependent(struct acpi_device *adev,
356
356
357
357
static int __acpi_power_on (struct acpi_power_resource * resource )
358
358
{
359
+ acpi_handle handle = resource -> device .handle ;
359
360
struct acpi_power_dependent_device * dep ;
360
361
acpi_status status = AE_OK ;
361
362
362
- status = acpi_evaluate_object (resource -> device . handle , "_ON" , NULL , NULL );
363
+ status = acpi_evaluate_object (handle , "_ON" , NULL , NULL );
363
364
if (ACPI_FAILURE (status )) {
364
365
resource -> state = ACPI_POWER_RESOURCE_STATE_UNKNOWN ;
365
366
return - ENODEV ;
366
367
}
367
368
368
369
resource -> state = ACPI_POWER_RESOURCE_STATE_ON ;
369
370
370
- pr_debug ( "Power resource [%s] turned on\n" , resource -> name );
371
+ acpi_handle_debug ( handle , "Power resource turned on\n" );
371
372
372
373
/*
373
374
* If there are other dependents on this power resource we need to
@@ -392,7 +393,8 @@ static int acpi_power_on_unlocked(struct acpi_power_resource *resource)
392
393
int result = 0 ;
393
394
394
395
if (resource -> ref_count ++ ) {
395
- pr_debug ("Power resource [%s] already on\n" , resource -> name );
396
+ acpi_handle_debug (resource -> device .handle ,
397
+ "Power resource already on\n" );
396
398
} else {
397
399
result = __acpi_power_on (resource );
398
400
if (result )
@@ -413,18 +415,18 @@ static int acpi_power_on(struct acpi_power_resource *resource)
413
415
414
416
static int __acpi_power_off (struct acpi_power_resource * resource )
415
417
{
418
+ acpi_handle handle = resource -> device .handle ;
416
419
acpi_status status ;
417
420
418
- status = acpi_evaluate_object (resource -> device .handle , "_OFF" ,
419
- NULL , NULL );
421
+ status = acpi_evaluate_object (handle , "_OFF" , NULL , NULL );
420
422
if (ACPI_FAILURE (status )) {
421
423
resource -> state = ACPI_POWER_RESOURCE_STATE_UNKNOWN ;
422
424
return - ENODEV ;
423
425
}
424
426
425
427
resource -> state = ACPI_POWER_RESOURCE_STATE_OFF ;
426
428
427
- pr_debug ( "Power resource [%s] turned off\n" , resource -> name );
429
+ acpi_handle_debug ( handle , "Power resource turned off\n" );
428
430
429
431
return 0 ;
430
432
}
@@ -434,12 +436,14 @@ static int acpi_power_off_unlocked(struct acpi_power_resource *resource)
434
436
int result = 0 ;
435
437
436
438
if (!resource -> ref_count ) {
437
- pr_debug ("Power resource [%s] already off\n" , resource -> name );
439
+ acpi_handle_debug (resource -> device .handle ,
440
+ "Power resource already off\n" );
438
441
return 0 ;
439
442
}
440
443
441
444
if (-- resource -> ref_count ) {
442
- pr_debug ("Power resource [%s] still in use\n" , resource -> name );
445
+ acpi_handle_debug (resource -> device .handle ,
446
+ "Power resource still in use\n" );
443
447
} else {
444
448
result = __acpi_power_off (resource );
445
449
if (result )
@@ -1004,7 +1008,7 @@ void acpi_resume_power_resources(void)
1004
1008
1005
1009
if (state == ACPI_POWER_RESOURCE_STATE_OFF
1006
1010
&& resource -> ref_count ) {
1007
- dev_dbg ( & resource -> device .dev , "Turning ON\n" );
1011
+ acpi_handle_debug ( resource -> device .handle , "Turning ON\n" );
1008
1012
__acpi_power_on (resource );
1009
1013
}
1010
1014
@@ -1034,7 +1038,7 @@ void acpi_turn_off_unused_power_resources(void)
1034
1038
*/
1035
1039
if (!resource -> ref_count &&
1036
1040
resource -> state != ACPI_POWER_RESOURCE_STATE_OFF ) {
1037
- dev_dbg ( & resource -> device .dev , "Turning OFF\n" );
1041
+ acpi_handle_debug ( resource -> device .handle , "Turning OFF\n" );
1038
1042
__acpi_power_off (resource );
1039
1043
}
1040
1044
0 commit comments