Re: [PATCH 7/7] iio: temperature: mlx90635: Remove dev_err_probe() if error is -ENOMEM
From: Crt Mori
Date: Thu Aug 21 2025 - 07:48:48 EST
I am not sure I agree with this. It provides an error message with
reason and I understand we want as few as possible, but this would be
a valid remark inside the logs?
On Thu, 21 Aug 2025 at 10:08, Xichao Zhao <zhao.xichao@xxxxxxxx> wrote:
>
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@xxxxxxxx>
> ---
> drivers/iio/temperature/mlx90635.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c
> index f7f88498ba0e..6d386d887855 100644
> --- a/drivers/iio/temperature/mlx90635.c
> +++ b/drivers/iio/temperature/mlx90635.c
> @@ -939,7 +939,7 @@ static int mlx90635_probe(struct i2c_client *client)
>
> indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*mlx90635));
> if (!indio_dev)
> - return dev_err_probe(&client->dev, -ENOMEM, "failed to allocate device\n");
> + return -ENOMEM;
>
> regmap = devm_regmap_init_i2c(client, &mlx90635_regmap);
> if (IS_ERR(regmap))
> --
> 2.34.1
>