Commit 47303f94 authored by Fabio Estevam's avatar Fabio Estevam Committed by Jassi Brar

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: 2bb70056 ("mailbox: Add support for i.MX messaging unit")
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Reviewed-by: default avatarPeng Fan <peng.fan@nxp.com>
Acked-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
[Jassi: fixed merge/am conflict]
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 1b3a347b
......@@ -513,8 +513,10 @@ static int imx_mu_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv);
ret = devm_mbox_controller_register(dev, &priv->mbox);
if (ret)
if (ret) {
clk_disable_unprepare(priv->clk);
return ret;
}
pm_runtime_enable(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment