Skip to content

Commit 7a9490a

Browse files
committed
ACPI: fan: Fold two simple functions into their only caller
Both acpi_fan_has_fst() and acpi_fan_is_acpi4() are called from one place only, so fold them both into there caller which yields slightly leaner code that is somewhat easier to follow. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3386797.aeNJFYEL58@rafael.j.wysocki
1 parent b320789 commit 7a9490a

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

drivers/acpi/fan_core.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,6 @@ static const struct thermal_cooling_device_ops fan_cooling_ops = {
203203
* --------------------------------------------------------------------------
204204
*/
205205

206-
static bool acpi_fan_has_fst(struct acpi_device *device)
207-
{
208-
return acpi_has_method(device->handle, "_FST");
209-
}
210-
211-
static bool acpi_fan_is_acpi4(struct acpi_device *device)
212-
{
213-
return acpi_has_method(device->handle, "_FIF") &&
214-
acpi_has_method(device->handle, "_FPS") &&
215-
acpi_has_method(device->handle, "_FSL");
216-
}
217-
218206
static int acpi_fan_get_fif(struct acpi_device *device)
219207
{
220208
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -331,9 +319,11 @@ static int acpi_fan_probe(struct platform_device *pdev)
331319
device->driver_data = fan;
332320
platform_set_drvdata(pdev, fan);
333321

334-
if (acpi_fan_has_fst(device)) {
322+
if (acpi_has_method(device->handle, "_FST")) {
335323
fan->has_fst = true;
336-
fan->acpi4 = acpi_fan_is_acpi4(device);
324+
fan->acpi4 = acpi_has_method(device->handle, "_FIF") &&
325+
acpi_has_method(device->handle, "_FPS") &&
326+
acpi_has_method(device->handle, "_FSL");
337327
}
338328

339329
if (fan->acpi4) {

0 commit comments

Comments
 (0)