mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND 1/2] media: i2c: isl7998x: Inline i2c_check_functionality() check
@ 2026-09-09  8:20 Thorsten Blum
  2026-09-09  8:20 ` [PATCH RESEND 2/2] i2c: Change return type to bool for i2c_check_functionality() Thorsten Blum
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-09-09  8:20 UTC (permalink / raw)
  To: Wolfram Sang, Michael Tretter, Pengutronix Kernel Team,
	Mauro Carvalho Chehab
  Cc: linux-media, linux-i2c, linux-kernel, Thorsten Blum

Inline the i2c_check_functionality() check, since the function returns a
boolean status rather than an error code.

Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
Wolfram, could you please apply this last conversion, since this patch
has not been applied yet despite several resends since April? Thanks.
---
 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 a77538d2343c..8244d4296a02 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] 4+ messages in thread

* [PATCH RESEND 2/2] i2c: Change return type to bool for i2c_check_functionality()
  2026-09-09  8:20 [PATCH RESEND 1/2] media: i2c: isl7998x: Inline i2c_check_functionality() check Thorsten Blum
@ 2026-09-09  8:20 ` Thorsten Blum
  2026-09-09 16:31   ` Andi Shyti
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-09-09  8:20 UTC (permalink / raw)
  To: Wolfram Sang, Andi Shyti
  Cc: linux-media, linux-i2c, linux-kernel, Thorsten Blum,
	Mukesh Kumar Savaliya

i2c_check_functionality() returns a bool - change the return type from
int to bool and update the comment accordingly.

Signed-off-by: Thorsten Blum <blum@kernel.org>
Acked-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>
---
 include/linux/i2c.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 14ab4d3055af..4af2df969a05 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -919,8 +919,8 @@ static inline u32 i2c_get_functionality(struct i2c_adapter *adap)
 	return adap->algo->functionality(adap);
 }
 
-/* Return 1 if adapter supports everything we need, 0 if not. */
-static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func)
+/* Return true if adapter supports everything we need, false if not. */
+static inline bool i2c_check_functionality(struct i2c_adapter *adap, u32 func)
 {
 	return (func & i2c_get_functionality(adap)) == func;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND 2/2] i2c: Change return type to bool for i2c_check_functionality()
  2026-09-09  8:20 ` [PATCH RESEND 2/2] i2c: Change return type to bool for i2c_check_functionality() Thorsten Blum
@ 2026-09-09 16:31   ` Andi Shyti
  2026-09-09 16:58     ` Thorsten Blum
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Shyti @ 2026-09-09 16:31 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Wolfram Sang, linux-media, linux-i2c, linux-kernel,
	Mukesh Kumar Savaliya

Hi Thorsten,

On Wed, Sep 09, 2026 at 10:20:56AM +0200, Thorsten Blum wrote:
> i2c_check_functionality() returns a bool - change the return type from
> int to bool and update the comment accordingly.
> 
> Signed-off-by: Thorsten Blum <blum@kernel.org>
> Acked-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>

both patches merged to i2c/i2c.

For some reason I don't see anywhere in my mailbox your patch
1/1, I had to fish it out from patchwork.

Thanks,
Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND 2/2] i2c: Change return type to bool for i2c_check_functionality()
  2026-09-09 16:31   ` Andi Shyti
@ 2026-09-09 16:58     ` Thorsten Blum
  0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-09-09 16:58 UTC (permalink / raw)
  To: Andi Shyti
  Cc: Wolfram Sang, linux-media, linux-i2c, linux-kernel,
	Mukesh Kumar Savaliya

On Wed, Sep 09, 2026 at 06:31:14PM +0200, Andi Shyti wrote:
> Hi Thorsten,
> 
> On Wed, Sep 09, 2026 at 10:20:56AM +0200, Thorsten Blum wrote:
> > i2c_check_functionality() returns a bool - change the return type from
> > int to bool and update the comment accordingly.
> > 
> > Signed-off-by: Thorsten Blum <blum@kernel.org>
> > Acked-by: Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>
> 
> both patches merged to i2c/i2c.
> 
> For some reason I don't see anywhere in my mailbox your patch
> 1/1, I had to fish it out from patchwork.

I might have messed up the git send-email recipients and my config ended
up adding you only to patch 2/2. Apologies!

Thanks,
Thorsten

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-09 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-09  8:20 [PATCH RESEND 1/2] media: i2c: isl7998x: Inline i2c_check_functionality() check Thorsten Blum
2026-09-09  8:20 ` [PATCH RESEND 2/2] i2c: Change return type to bool for i2c_check_functionality() Thorsten Blum
2026-09-09 16:31   ` Andi Shyti
2026-09-09 16:58     ` Thorsten Blum

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®