ACPI: thermal: Remove redundant acpi_has_method() calls
The following acpi_has_method() calls are unnecessary since acpi_execute_simple_method() and acpi_evaluate_reference() will return an error if the given method does not exist. Remove acpi_has_method() calls to avoid additional work. Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com> [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
85a5f06773
commit
e88c7409c9
@@ -225,13 +225,9 @@ static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
|
|||||||
if (!tz)
|
if (!tz)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!acpi_has_method(tz->device->handle, "_SCP")) {
|
if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n"));
|
"_SCP", mode)))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
} else if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
|
|
||||||
"_SCP", mode))) {
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -463,8 +459,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flag & ACPI_TRIPS_DEVICES)
|
if (flag & ACPI_TRIPS_DEVICES) {
|
||||||
&& acpi_has_method(tz->device->handle, "_TZD")) {
|
|
||||||
memset(&devices, 0, sizeof(devices));
|
memset(&devices, 0, sizeof(devices));
|
||||||
status = acpi_evaluate_reference(tz->device->handle, "_TZD",
|
status = acpi_evaluate_reference(tz->device->handle, "_TZD",
|
||||||
NULL, &devices);
|
NULL, &devices);
|
||||||
|
Reference in New Issue
Block a user