* [PATCH RESEND] media: i2c: isl7998x: inline i2c_check_functionality check
@ 2026-05-17 17:20 Thorsten Blum
2026-05-19 14:23 ` Michael Tretter
0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Blum @ 2026-05-17 17:20 UTC (permalink / raw)
To: Michael Tretter, Pengutronix Kernel Team, Mauro Carvalho Chehab
Cc: Thorsten Blum, linux-media, linux-kernel
Inline the i2c_check_functionality() check, since the function returns a
boolean status rather than an error code.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/media/i2c/isl7998x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c
index 5ffd53e005ee..96702c5eaa35 100644
--- a/drivers/media/i2c/isl7998x.c
+++ b/drivers/media/i2c/isl7998x.c
@@ -1460,8 +1460,7 @@ static int isl7998x_probe(struct i2c_client *client)
int nr_inputs;
int ret;
- ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA);
- if (!ret) {
+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
dev_warn(&adapter->dev,
"I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
return -EIO;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] media: i2c: isl7998x: inline i2c_check_functionality check
2026-05-17 17:20 [PATCH RESEND] media: i2c: isl7998x: inline i2c_check_functionality check Thorsten Blum
@ 2026-05-19 14:23 ` Michael Tretter
2026-05-19 14:35 ` Thorsten Blum
0 siblings, 1 reply; 3+ messages in thread
From: Michael Tretter @ 2026-05-19 14:23 UTC (permalink / raw)
To: Thorsten Blum
Cc: Pengutronix Kernel Team, Mauro Carvalho Chehab, linux-media,
linux-kernel
On Sun, 17 May 2026 19:20:35 +0200, Thorsten Blum wrote:
> Inline the i2c_check_functionality() check, since the function returns a
> boolean status rather than an error code.
Actually, i2c_check_functionality() returns the boolean result of the
comparison as an int. It's better to treat it like a boolean, though.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> drivers/media/i2c/isl7998x.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c
> index 5ffd53e005ee..96702c5eaa35 100644
> --- a/drivers/media/i2c/isl7998x.c
> +++ b/drivers/media/i2c/isl7998x.c
> @@ -1460,8 +1460,7 @@ static int isl7998x_probe(struct i2c_client *client)
> int nr_inputs;
> int ret;
>
> - ret = i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA);
> - if (!ret) {
> + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
> dev_warn(&adapter->dev,
> "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
> return -EIO;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH RESEND] media: i2c: isl7998x: inline i2c_check_functionality check
2026-05-19 14:23 ` Michael Tretter
@ 2026-05-19 14:35 ` Thorsten Blum
0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-05-19 14:35 UTC (permalink / raw)
To: Michael Tretter
Cc: Pengutronix Kernel Team, Mauro Carvalho Chehab, linux-media,
linux-kernel
On Tue, May 19, 2026 at 04:23:56PM +0200, Michael Tretter wrote:
> On Sun, 17 May 2026 19:20:35 +0200, Thorsten Blum wrote:
> > Inline the i2c_check_functionality() check, since the function returns a
> > boolean status rather than an error code.
>
> Actually, i2c_check_functionality() returns the boolean result of the
> comparison as an int. It's better to treat it like a boolean, though.
>
> >
> > Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>
> Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Thank you for your review.
I sent a patch [1] to change i2c_check_functionality() to bool, but
Wolfram asked to change the int call sites first.
[1] https://lore.kernel.org/lkml/20260421161607.61314-3-thorsten.blum@linux.dev/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-19 14:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-17 17:20 [PATCH RESEND] media: i2c: isl7998x: inline i2c_check_functionality check Thorsten Blum
2026-05-19 14:23 ` Michael Tretter
2026-05-19 14:35 ` Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox