Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: imx: imx8: Fix an error handling path in imx8_acm_clk_probe()

If an error occurs after a successful clk_imx_acm_attach_pm_domains() call,
it must be undone.

Add an explicit error handling path, re-order the code and add the missing
clk_imx_acm_detach_pm_domains() call.

Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

authored by

Christophe JAILLET and committed by
Abel Vesa
e9a164e3 9a0108ac

+7 -4
+7 -4
drivers/clk/imx/clk-imx8-acm.c
··· 374 374 0, NULL, NULL); 375 375 if (IS_ERR(hws[sels[i].clkid])) { 376 376 ret = PTR_ERR(hws[sels[i].clkid]); 377 - pm_runtime_disable(&pdev->dev); 378 377 goto err_clk_register; 379 378 } 380 379 } ··· 383 384 ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data); 384 385 if (ret < 0) { 385 386 dev_err(dev, "failed to register hws for ACM\n"); 386 - pm_runtime_disable(&pdev->dev); 387 + goto err_clk_register; 387 388 } 388 389 389 - err_clk_register: 390 - 391 390 pm_runtime_put_sync(&pdev->dev); 391 + return 0; 392 + 393 + err_clk_register: 394 + pm_runtime_put_sync(&pdev->dev); 395 + pm_runtime_disable(&pdev->dev); 396 + clk_imx_acm_detach_pm_domains(&pdev->dev, &priv->dev_pm); 392 397 393 398 return ret; 394 399 }