media: i2c: isl7998x: Inline i2c_check_functionality() check
PATCH RESEND 1/2 media: i2c: isl7998x: Inline i2c_check_functionality() check
Inline the i2c_check_functionality() check, since the function returns a boolean status rather than an error code.
---
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(-)
drivers/media/i2c/isl7998x.c +1 -2
@@ -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 ;
PATCH RESEND 2/2 i2c: Change return type to bool for i2c_check_functionality()
i2c_check_functionality() returns a bool - change the return type from int to bool and update the comment accordingly.
--- include/linux/i2c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/i2c.h +2 -2
@@ -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; }
Andi Shyti
maintainerRe: [PATCH RESEND 2/2] i2c: Change return type to bool for i2c_check_functionality()
Hi Thorsten,
Quoted 5 lines · Thorsten Blum
i2c_check_functionality()returns a bool - change the return type from int to bool and update the comment accordingly.Signed-off-by Thorsten Blum <[email protected]>
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
Re: [PATCH RESEND 2/2] i2c: Change return type to bool for i2c_check_functionality()
Quoted 6 lines · Andi Shyti
Hi Thorsten,
Quoted 3 lines · Thorsten Blum
i2c_check_functionality()returns a bool - change the return type from int to bool and update the comment accordingly.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Thorsten Blum <[email protected]>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