Re: [PATCH 3/6] iio: imu: inv_icm42600: Remove redundant error msg on regulator_disable()
From: Jonathan Cameron
Date: Sun Jul 13 2025 - 10:22:16 EST
On Wed, 09 Jul 2025 14:35:11 +0200
Sean Nyekjaer <sean@xxxxxxxxxx> wrote:
> The regulator framework already emits an error message when
> regulator_disable() fails, making the local dev_err() redundant.
> Remove the duplicate message to avoid cluttering the kernel log
> with the same error twice.
>
> Signed-off-by: Sean Nyekjaer <sean@xxxxxxxxxx>
> ---
> drivers/iio/imu/inv_icm42600/inv_icm42600_core.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> index 35f7c66d77790829a739d2c54ba77e53903a9297..55a29b1e2b11355598b0ede7af22857aed3ae134 100644
> --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> @@ -700,12 +700,8 @@ static int inv_icm42600_enable_regulator_vddio(struct inv_icm42600_state *st)
> static void inv_icm42600_disable_vddio_reg(void *_data)
> {
> struct inv_icm42600_state *st = _data;
> - const struct device *dev = regmap_get_device(st->map);
> - int ret;
>
> - ret = regulator_disable(st->vddio_supply);
> - if (ret)
> - dev_err(dev, "failed to disable vddio error %d\n", ret);
Dropping this message (which is sensible) reinforces my lack of warm
fuzzy feelings about patch 1. I'd definitely leave those other calls
alone and keep this as just a tight wrapper around st. Note though that
can just pass the regulator as the parameter to the devm_add_action_or_reset()
and simplify this a bit more now you don't need to get to the dev.
> + regulator_disable(st->vddio_supply);
> }
>
> static void inv_icm42600_disable_pm(void *_data)
>