Skip to content

Commit 47303f9

Browse files
fabioestevamJassiBrar
authored andcommitted
mailbox: imx: Disable the clock on devm_mbox_controller_register() failure
devm_mbox_controller_register() may fail, and in the case of failure the priv->clk clock that was previously enabled, should be disabled. Fixes: 2bb7005 ("mailbox: Add support for i.MX messaging unit") Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Peng Fan <[email protected]> Acked-by: Oleksij Rempel <[email protected]> [Jassi: fixed merge/am conflict] Signed-off-by: Jassi Brar <[email protected]>
1 parent 1b3a347 commit 47303f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mailbox/imx-mailbox.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,10 @@ static int imx_mu_probe(struct platform_device *pdev)
513513
platform_set_drvdata(pdev, priv);
514514

515515
ret = devm_mbox_controller_register(dev, &priv->mbox);
516-
if (ret)
516+
if (ret) {
517+
clk_disable_unprepare(priv->clk);
517518
return ret;
519+
}
518520

519521
pm_runtime_enable(dev);
520522

0 commit comments

Comments
 (0)