Re: [PATCH] iio: imu: inv_icm45600: fix regulator put warning when probe fails
From: Andy Shevchenko
Date: Thu Feb 05 2026 - 11:22:23 EST
On Thu, Feb 05, 2026 at 02:35:33PM +0100, Jean-Baptiste Maneyrol via B4 Relay wrote:
> When the driver probe fails we encounter a regulator put warning
> because vddio regulator is not stopped before release. The issue
> comes from pm_runtime not already setup when core probe fails and
> the vddio regulator disable callback is called.
>
> Fix the issue by deleting pm_runtime check in the vddio regulator
> disable callback and handing over the vddio disable management to
> pm_runtime by deleting the disable remove action before setting up
> pm_runtime.
...
> + /* hand over vddio management to pm_runtime */
> + devm_remove_action(dev, inv_icm45600_disable_vddio_reg, st);
First of all, note "remove" vs. "release". Have you tried to remove and insert
module several times? Does kmemleak happy about this?
Second, calling devm_*() for release resources is very exceptional situation.
This usually means that something is wrong to begin with in the probe.
Can you find a better way without calling devm_*() for releasing resources?
--
With Best Regards,
Andy Shevchenko