[PATCH] ASoC: da7213: Disable runtime PM on component registration failure

From: Haowen Tu

Date: Tue Nov 17 2026 - 21:13:18 EST


The probe function enables runtime PM before registering the ASoC
component. If component registration fails, it returns the error without
disabling runtime PM. The remove callback is not called for a failed
probe, so runtime PM remains enabled while devres releases the regmap and
powers off the supplies.

Disable runtime PM on component registration failure before returning the
error and allowing the managed resources to be released.

Fixes: b2a378816d0f ("ASoC: da7213: Add regulator support")
Signed-off-by: Haowen Tu <tuhaowen@xxxxxxxxxxxxx>
---
sound/soc/codecs/da7213.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c
index b08e8ab6b421..53ed58ca9ab2 100644
--- a/sound/soc/codecs/da7213.c
+++ b/sound/soc/codecs/da7213.c
@@ -2242,6 +2242,7 @@ static int da7213_i2c_probe(struct i2c_client *i2c)
if (ret < 0) {
dev_err(&i2c->dev, "Failed to register da7213 component: %d\n",
ret);
+ pm_runtime_disable(&i2c->dev);
}
return ret;
}
--
2.50.1