[PATCH 08/12] media: adv7511: use string_choices helpers

From: Balakrishnan Sambath

Date: Wed May 27 2026 - 10:47:42 EST


Replace open-coded boolean-to-string ternaries with the standard
helpers from <linux/string_choices.h>.

No functional change.

Signed-off-by: Balakrishnan Sambath <balakrishnan.s@xxxxxxxxxxxxx>
---
drivers/media/i2c/adv7511-v4l2.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/adv7511-v4l2.c b/drivers/media/i2c/adv7511-v4l2.c
index 860cff50c..062ef8844 100644
--- a/drivers/media/i2c/adv7511-v4l2.c
+++ b/drivers/media/i2c/adv7511-v4l2.c
@@ -16,6 +16,7 @@
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/delay.h>
+#include <linux/string_choices.h>
#include <linux/videodev2.h>
#include <linux/workqueue.h>
#include <linux/hdmi.h>
@@ -583,7 +584,7 @@ static int adv7511_log_status(struct v4l2_subdev *sd)
"9", "A", "B", "C", "D", "E", "F"
};

- v4l2_info(sd, "power %s\n", state->power_on ? "on" : "off");
+ v4l2_info(sd, "power %s\n", str_on_off(state->power_on));
v4l2_info(sd, "%s hotplug, %s Rx Sense, %s EDID (%d block(s))\n",
(adv7511_rd(sd, 0x42) & MASK_ADV7511_HPD_DETECT) ? "detected" : "no",
(adv7511_rd(sd, 0x42) & MASK_ADV7511_MSEN_DETECT) ? "detected" : "no",
@@ -592,8 +593,7 @@ static int adv7511_log_status(struct v4l2_subdev *sd)
v4l2_info(sd, "%s output %s\n",
(adv7511_rd(sd, 0xaf) & 0x02) ?
"HDMI" : "DVI-D",
- (adv7511_rd(sd, 0xa1) & 0x3c) ?
- "disabled" : "enabled");
+ str_disabled_enabled(adv7511_rd(sd, 0xa1) & 0x3c));
v4l2_info(sd, "state: %s, error: %s, detect count: %u, msk/irq: %02x/%02x\n",
states[adv7511_rd(sd, 0xc8) & 0xf],
errors[adv7511_rd(sd, 0xc8) >> 4], state->edid_detect_counter,
@@ -635,8 +635,7 @@ static int adv7511_log_status(struct v4l2_subdev *sd)

v4l2_info(sd, "i2c cec addr: 0x%x\n", state->i2c_cec_addr);

- v4l2_info(sd, "CEC: %s\n", state->cec_enabled_adap ?
- "enabled" : "disabled");
+ v4l2_info(sd, "CEC: %s\n", str_enabled_disabled(state->cec_enabled_adap));
if (state->cec_enabled_adap) {
for (i = 0; i < ADV7511_MAX_ADDRS; i++) {
bool is_valid = state->cec_valid_addrs & (1 << i);
@@ -657,7 +656,7 @@ static int adv7511_s_power(struct v4l2_subdev *sd, int on)
const int retries = 20;
int i;

- v4l2_dbg(1, debug, sd, "%s: power %s\n", __func__, on ? "on" : "off");
+ v4l2_dbg(1, debug, sd, "%s: power %s\n", __func__, str_on_off(on));

state->power_on = on;


--
2.34.1