media: i2c: isl7998x: inline i2c_check_functionality check
Subsystems (2)
PATCH RESEND 1/1 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.
--- 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 ;
Quoted 2 lines · Thorsten Blum
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.
Quoted 2 lines
Signed-off-by Thorsten Blum <[email protected]>
Quoted 19 lines
--- 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 ;
Quoted 11 lines · Michael Tretter
Quoted 2 lines · Thorsten Blum
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.Quoted 2 lines
Signed-off-by Thorsten Blum <[email protected]>Reviewed-by Michael Tretter <[email protected]>
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.