From: Balakrishnan Sambath <balakrishnan.s@microchip.com>
To: "Jacopo Mondi" <jacopo+renesas@jmondi.org>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
"Laurent Pinchart" <laurent.pinchart+renesas@ideasonboard.com>,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Tim Harvey" <tharvey@gateworks.com>,
"Hans Verkuil" <hverkuil@kernel.org>
Cc: <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Balakrishnan Sambath <balakrishnan.s@microchip.com>
Subject: [PATCH 09/12] media: saa7127: use string_choices helpers
Date: Wed, 27 May 2026 20:10:58 +0530 [thread overview]
Message-ID: <20260527-cleanup-string-choices-media-i2c-v1-9-e8f7d2284288@microchip.com> (raw)
In-Reply-To: <20260527-cleanup-string-choices-media-i2c-v1-0-e8f7d2284288@microchip.com>
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@microchip.com>
---
drivers/media/i2c/saa7127.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c
index fdf17f6fa..182b40855 100644
--- a/drivers/media/i2c/saa7127.c
+++ b/drivers/media/i2c/saa7127.c
@@ -39,6 +39,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
+#include <linux/string_choices.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <media/i2c/saa7127.h>
@@ -343,7 +344,7 @@ static int saa7127_set_vps(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_
if (enable && (data->field != 0 || data->line != 16))
return -EINVAL;
if (state->vps_enable != enable) {
- v4l2_dbg(1, debug, sd, "Turn VPS Signal %s\n", enable ? "on" : "off");
+ v4l2_dbg(1, debug, sd, "Turn VPS Signal %s\n", str_on_off(enable));
saa7127_write(sd, 0x54, enable << 7);
state->vps_enable = enable;
}
@@ -376,7 +377,7 @@ static int saa7127_set_cc(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_d
return -EINVAL;
if (state->cc_enable != enable) {
v4l2_dbg(1, debug, sd,
- "Turn CC %s\n", enable ? "on" : "off");
+ "Turn CC %s\n", str_on_off(enable));
saa7127_write(sd, SAA7127_REG_CLOSED_CAPTION,
(state->xds_enable << 7) | (enable << 6) | 0x11);
state->cc_enable = enable;
@@ -402,7 +403,7 @@ static int saa7127_set_xds(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_
if (enable && (data->field != 1 || data->line != 21))
return -EINVAL;
if (state->xds_enable != enable) {
- v4l2_dbg(1, debug, sd, "Turn XDS %s\n", enable ? "on" : "off");
+ v4l2_dbg(1, debug, sd, "Turn XDS %s\n", str_on_off(enable));
saa7127_write(sd, SAA7127_REG_CLOSED_CAPTION,
(enable << 7) | (state->cc_enable << 6) | 0x11);
state->xds_enable = enable;
@@ -427,7 +428,7 @@ static int saa7127_set_wss(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_
if (enable && (data->field != 0 || data->line != 23))
return -EINVAL;
if (state->wss_enable != enable) {
- v4l2_dbg(1, debug, sd, "Turn WSS %s\n", enable ? "on" : "off");
+ v4l2_dbg(1, debug, sd, "Turn WSS %s\n", str_on_off(enable));
saa7127_write(sd, 0x27, enable << 7);
state->wss_enable = enable;
}
@@ -674,8 +675,8 @@ static int saa7127_log_status(struct v4l2_subdev *sd)
output_strs[state->output_type] : "disabled");
v4l2_info(sd, "WSS: %s\n", state->wss_enable ?
wss_strs[state->wss_mode] : "disabled");
- v4l2_info(sd, "VPS: %s\n", state->vps_enable ? "enabled" : "disabled");
- v4l2_info(sd, "CC: %s\n", state->cc_enable ? "enabled" : "disabled");
+ v4l2_info(sd, "VPS: %s\n", str_enabled_disabled(state->vps_enable));
+ v4l2_info(sd, "CC: %s\n", str_enabled_disabled(state->cc_enable));
return 0;
}
--
2.34.1
next prev parent reply other threads:[~2026-05-27 14:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 14:40 [PATCH 00/12] media: i2c: convert ternaries to " Balakrishnan Sambath
2026-05-27 14:40 ` [PATCH 01/12] media: max9286: use string_choices helper Balakrishnan Sambath
2026-05-27 14:40 ` [PATCH 02/12] media: saa7110: " Balakrishnan Sambath
2026-05-27 14:40 ` [PATCH 03/12] media: tvp7002: " Balakrishnan Sambath
2026-05-27 14:40 ` [PATCH 04/12] media: vpx3220: " Balakrishnan Sambath
2026-05-27 14:40 ` [PATCH 05/12] media: msp3400: use string_choices helpers Balakrishnan Sambath
2026-05-27 14:40 ` [PATCH 06/12] media: tda1997x: use string_choices helper Balakrishnan Sambath
2026-05-27 14:40 ` [PATCH 07/12] media: ths8200: use string_choices helpers Balakrishnan Sambath
2026-05-27 14:40 ` [PATCH 08/12] media: adv7511: " Balakrishnan Sambath
2026-05-27 14:40 ` Balakrishnan Sambath [this message]
2026-05-27 14:40 ` [PATCH 10/12] media: adv7604: " Balakrishnan Sambath
2026-05-27 14:41 ` [PATCH 11/12] media: tc358743: " Balakrishnan Sambath
2026-05-27 14:41 ` [PATCH 12/12] media: adv7842: " Balakrishnan Sambath
2026-05-27 20:54 ` [PATCH 00/12] media: i2c: convert ternaries to " Laurent Pinchart
2026-06-04 6:07 ` Balakrishnan.S
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260527-cleanup-string-choices-media-i2c-v1-9-e8f7d2284288@microchip.com \
--to=balakrishnan.s@microchip.com \
--cc=hverkuil@kernel.org \
--cc=jacopo+renesas@jmondi.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=tharvey@gateworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®