Skip to content

Commit c34068c

Browse files
andy-shevjwrdegoede
authored andcommitted
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>
1 parent bb9a9bf commit c34068c

File tree

1 file changed

+3
-4
lines changed
  • drivers/platform/x86/intel

1 file changed

+3
-4
lines changed

drivers/platform/x86/intel/hid.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/kernel.h>
1414
#include <linux/module.h>
1515
#include <linux/platform_device.h>
16+
#include <linux/string_choices.h>
1617
#include <linux/suspend.h>
1718
#include "../dual_accel_detect.h"
1819

@@ -331,10 +332,8 @@ static int intel_hid_set_enable(struct device *device, bool enable)
331332
acpi_handle handle = ACPI_HANDLE(device);
332333

333334
/* Enable|disable features - power button is always enabled */
334-
if (!intel_hid_execute_method(handle, INTEL_HID_DSM_HDSM_FN,
335-
enable)) {
336-
dev_warn(device, "failed to %sable hotkeys\n",
337-
enable ? "en" : "dis");
335+
if (!intel_hid_execute_method(handle, INTEL_HID_DSM_HDSM_FN, enable)) {
336+
dev_warn(device, "failed to %s hotkeys\n", str_enable_disable(enable));
338337
return -EIO;
339338
}
340339

0 commit comments

Comments
 (0)