Skip to content

Commit 15fa062

Browse files
tobluxTzung-Bi Shih
authored andcommitted
platform/chrome: cros_usbpd_logger: Use str_enabled_disabled() helper
Remove hard-coded strings by using the str_enabled_disabled() helper function. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20250112100655.55741-2-thorsten.blum@linux.dev Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
1 parent be4fccb commit 15fa062

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/platform/chrome/cros_usbpd_logger.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/platform_data/cros_ec_proto.h>
1414
#include <linux/platform_device.h>
1515
#include <linux/rtc.h>
16+
#include <linux/string_choices.h>
1617

1718
#define DRV_NAME "cros-usbpd-logger"
1819

@@ -135,8 +136,8 @@ static void cros_usbpd_print_log_entry(struct ec_response_pd_log *r,
135136
len += append_str(buf, len, "Power supply fault: %s", fault);
136137
break;
137138
case PD_EVENT_VIDEO_DP_MODE:
138-
len += append_str(buf, len, "DP mode %sabled", r->data == 1 ?
139-
"en" : "dis");
139+
len += append_str(buf, len, "DP mode %s",
140+
str_enabled_disabled(r->data == 1));
140141
break;
141142
case PD_EVENT_VIDEO_CODEC:
142143
minfo = (struct mcdp_info *)r->payload;

0 commit comments

Comments
 (0)