diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-08-28 13:03:13 +0200 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-09-04 20:24:11 +0200 |
| commit | 7a9490a1c929e00250f4be7749bd666f19a9c7ef (patch) | |
| tree | 20ee0f0018a8a940bd29e87ab57172f4cb3db4c4 | |
| parent | b320789d6883cc00ac78ce83bccbfe7ed58afcf0 (diff) | |
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
| -rw-r--r-- | drivers/acpi/fan_core.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c index 095502086b41..04ff608f2ff0 100644 --- a/drivers/acpi/fan_core.c +++ b/drivers/acpi/fan_core.c @@ -203,18 +203,6 @@ static const struct thermal_cooling_device_ops fan_cooling_ops = { * -------------------------------------------------------------------------- */ -static bool acpi_fan_has_fst(struct acpi_device *device) -{ - return acpi_has_method(device->handle, "_FST"); -} - -static bool acpi_fan_is_acpi4(struct acpi_device *device) -{ - return acpi_has_method(device->handle, "_FIF") && - acpi_has_method(device->handle, "_FPS") && - acpi_has_method(device->handle, "_FSL"); -} - static int acpi_fan_get_fif(struct acpi_device *device) { struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; @@ -331,9 +319,11 @@ static int acpi_fan_probe(struct platform_device *pdev) device->driver_data = fan; platform_set_drvdata(pdev, fan); - if (acpi_fan_has_fst(device)) { + if (acpi_has_method(device->handle, "_FST")) { fan->has_fst = true; - fan->acpi4 = acpi_fan_is_acpi4(device); + fan->acpi4 = acpi_has_method(device->handle, "_FIF") && + acpi_has_method(device->handle, "_FPS") && + acpi_has_method(device->handle, "_FSL"); } if (fan->acpi4) { |
