platform/x86: intel-hid: Use string_choices API instead of ternary operator

Use modern string_choices API instead of manually determining the
output using ternary operator.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240821120458.3702655-1-andriy.shevchenko@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Andy Shevchenko 2024-08-21 15:04:57 +03:00 committed by Hans de Goede
parent bb9a9bf278
commit c34068c8ed

View File

@ -13,6 +13,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/string_choices.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include "../dual_accel_detect.h" #include "../dual_accel_detect.h"
@ -331,10 +332,8 @@ static int intel_hid_set_enable(struct device *device, bool enable)
acpi_handle handle = ACPI_HANDLE(device); acpi_handle handle = ACPI_HANDLE(device);
/* Enable|disable features - power button is always enabled */ /* Enable|disable features - power button is always enabled */
if (!intel_hid_execute_method(handle, INTEL_HID_DSM_HDSM_FN, if (!intel_hid_execute_method(handle, INTEL_HID_DSM_HDSM_FN, enable)) {
enable)) { dev_warn(device, "failed to %s hotkeys\n", str_enable_disable(enable));
dev_warn(device, "failed to %sable hotkeys\n",
enable ? "en" : "dis");
return -EIO; return -EIO;
} }