Skip to content

Commit 2617595

Browse files
jmaneyrol-invnjic23
authored andcommitted
iio: imu: inv_icm45600: fix regulator put warning when probe fails
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 setting pm_runtime active early before vddio regulator resource cleanup. This requires to cut pm_runtime set_active and enable in 2 function calls. Fixes: 7ff021a ("iio: imu: inv_icm45600: add new inv_icm45600 driver") Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 0642340 commit 2617595

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/iio/imu/inv_icm45600/inv_icm45600_core.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,11 @@ int inv_icm45600_core_probe(struct regmap *regmap, const struct inv_icm45600_chi
744744
*/
745745
fsleep(5 * USEC_PER_MSEC);
746746

747+
/* set pm_runtime active early for disable vddio resource cleanup */
748+
ret = pm_runtime_set_active(dev);
749+
if (ret)
750+
return ret;
751+
747752
ret = inv_icm45600_enable_regulator_vddio(st);
748753
if (ret)
749754
return ret;
@@ -776,7 +781,7 @@ int inv_icm45600_core_probe(struct regmap *regmap, const struct inv_icm45600_chi
776781
if (ret)
777782
return ret;
778783

779-
ret = devm_pm_runtime_set_active_enabled(dev);
784+
ret = devm_pm_runtime_enable(dev);
780785
if (ret)
781786
return ret;
782787

0 commit comments

Comments
 (0)