diff options
author | Fabio Estevam <festevam@gmail.com> | 2020-05-30 17:56:28 -0500 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2020-05-30 17:58:39 -0500 |
commit | 47303f9438954bc7bca593310ac8685d11297725 (patch) | |
tree | fd0eafe3bf82b9c5d2911ba1fb94ef81891b9017 /drivers/mailbox/imx-mailbox.c | |
parent | 1b3a347b7d56aa637157da1b7df225071af1421f (diff) |
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: 2bb7005696e2 ("mailbox: Add support for i.MX messaging unit")
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
[Jassi: fixed merge/am conflict]
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox/imx-mailbox.c')
-rw-r--r-- | drivers/mailbox/imx-mailbox.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index cacc60662f24..19f8d79cebac 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -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); |