Re: [PATCH] mfd: menf21bmc: inline i2c_check_functionality check

From: Lee Jones

Date: Thu May 07 2026 - 09:50:25 EST


On Tue, 28 Apr 2026, Thorsten Blum wrote:

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

This my well be a personal thing, but I don't generally like functions
being stuffed into if () statements. So this one is a no I'm afraid.
Please leave it as it is.

> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> drivers/mfd/menf21bmc.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mfd/menf21bmc.c b/drivers/mfd/menf21bmc.c
> index 1d36095155e0..0f24de516d72 100644
> --- a/drivers/mfd/menf21bmc.c
> +++ b/drivers/mfd/menf21bmc.c
> @@ -54,11 +54,9 @@ menf21bmc_probe(struct i2c_client *client)
> int rev_major, rev_minor, rev_main;
> int ret;
>
> - ret = i2c_check_functionality(client->adapter,
> - I2C_FUNC_SMBUS_BYTE_DATA |
> - I2C_FUNC_SMBUS_WORD_DATA |
> - I2C_FUNC_SMBUS_BYTE);
> - if (!ret)
> + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA |
> + I2C_FUNC_SMBUS_WORD_DATA |
> + I2C_FUNC_SMBUS_BYTE))
> return -ENODEV;
>
> rev_major = i2c_smbus_read_word_data(client, BMC_CMD_REV_MAJOR);

--
Lee Jones