Skip to content

Commit 7d36289

Browse files
tobluxrafaeljw
authored andcommitted
ACPI: power: Use str_on_off() helper function
Use the str_on_off() helper function instead of hard-coded strings. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://patch.msgid.link/20250209220835.78434-2-thorsten.blum@linux.dev [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0ad2507 commit 7d36289

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/acpi/power.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/init.h>
3030
#include <linux/types.h>
3131
#include <linux/slab.h>
32+
#include <linux/string_choices.h>
3233
#include <linux/pm_runtime.h>
3334
#include <linux/sysfs.h>
3435
#include <linux/acpi.h>
@@ -197,7 +198,7 @@ static int __get_state(acpi_handle handle, u8 *state)
197198
cur_state = sta & ACPI_POWER_RESOURCE_STATE_ON;
198199

199200
acpi_handle_debug(handle, "Power resource is %s\n",
200-
cur_state ? "on" : "off");
201+
str_on_off(cur_state));
201202

202203
*state = cur_state;
203204
return 0;
@@ -240,7 +241,7 @@ static int acpi_power_get_list_state(struct list_head *list, u8 *state)
240241
break;
241242
}
242243

243-
pr_debug("Power resource list is %s\n", cur_state ? "on" : "off");
244+
pr_debug("Power resource list is %s\n", str_on_off(cur_state));
244245

245246
*state = cur_state;
246247
return 0;

0 commit comments

Comments
 (0)