<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 2, 2022 at 3:18 PM zhangqilong <<a href="mailto:zhangqilong3@huawei.com">zhangqilong3@huawei.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">a) Add missing pm_runtime_disable() when probe error out. It could<br>
avoid pm_runtime implementation complains when removing and probing<br>
again the driver.<br>
b) Add remove for missing pm_runtime_disable().<br>
<br>
Fix:c590fa80b3928 ("ASoC: fsl_xcvr: register platform component before registering cpu dai")<br>
Signed-off-by: Zhang Qilong <<a href="mailto:zhangqilong3@huawei.com" target="_blank">zhangqilong3@huawei.com</a>><br></blockquote><div><br></div><div>Acked-by: Shengjiu Wang <<a href="mailto:shengjiu.wang@gmail.com">shengjiu.wang@gmail.com</a>></div><div><br></div><div>Best regards</div><div>Wang shengjiu </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
v2:<br>
- Add remove to put PM usage counter.<br>
<br>
v3:<br>
- Modify the commit message.<br>
---<br>
sound/soc/fsl/fsl_xcvr.c | 9 +++++++++<br>
1 file changed, 9 insertions(+)<br>
<br>
diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c<br>
index d0556c79fdb1..55e640cba87d 100644<br>
--- a/sound/soc/fsl/fsl_xcvr.c<br>
+++ b/sound/soc/fsl/fsl_xcvr.c<br>
@@ -1228,6 +1228,7 @@ static int fsl_xcvr_probe(struct platform_device *pdev)<br>
*/<br>
ret = devm_snd_dmaengine_pcm_register(dev, NULL, 0);<br>
if (ret) {<br>
+ pm_runtime_disable(dev);<br>
dev_err(dev, "failed to pcm register\n");<br>
return ret;<br>
}<br>
@@ -1235,6 +1236,7 @@ static int fsl_xcvr_probe(struct platform_device *pdev)<br>
ret = devm_snd_soc_register_component(dev, &fsl_xcvr_comp,<br>
&fsl_xcvr_dai, 1);<br>
if (ret) {<br>
+ pm_runtime_disable(dev);<br>
dev_err(dev, "failed to register component %s\n",<br>
<a href="http://fsl_xcvr_comp.name" rel="noreferrer" target="_blank">fsl_xcvr_comp.name</a>);<br>
}<br>
@@ -1242,6 +1244,12 @@ static int fsl_xcvr_probe(struct platform_device *pdev)<br>
return ret;<br>
}<br>
<br>
+static int fsl_xcvr_remove(struct platform_device *pdev)<br>
+{<br>
+ pm_runtime_disable(&pdev->dev);<br>
+ return 0;<br>
+}<br>
+<br>
static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev)<br>
{<br>
struct fsl_xcvr *xcvr = dev_get_drvdata(dev);<br>
@@ -1370,6 +1378,7 @@ static struct platform_driver fsl_xcvr_driver = {<br>
.pm = &fsl_xcvr_pm_ops,<br>
.of_match_table = fsl_xcvr_dt_ids,<br>
},<br>
+ .remove = fsl_xcvr_remove,<br>
};<br>
module_platform_driver(fsl_xcvr_driver);<br>
<br>
-- <br>
2.31.1<br>
<br>
</blockquote></div></div>