[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB6PR0402MB2760C33F17B6234DBDB560C188B60@DB6PR0402MB2760.eurprd04.prod.outlook.com>
Date: Wed, 20 May 2020 03:27:50 +0000
From: Peng Fan <peng.fan@....com>
To: Fabio Estevam <festevam@...il.com>,
"jassisinghbrar@...il.com" <jassisinghbrar@...il.com>
CC: "kernel@...gutronix.de" <kernel@...gutronix.de>,
"o.rempel@...gutronix.de" <o.rempel@...gutronix.de>,
dl-linux-imx <linux-imx@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] mailbox: imx: Disable the clock on
devm_mbox_controller_register() failure
> Subject: [PATCH] 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@...il.com>
Reviewed-by: Peng Fan <peng.fan@....com>
> ---
> drivers/mailbox/imx-mailbox.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
> index 7906624a731c..3f7c4548c18f 100644
> --- a/drivers/mailbox/imx-mailbox.c
> +++ b/drivers/mailbox/imx-mailbox.c
> @@ -508,7 +508,13 @@ static int imx_mu_probe(struct platform_device
> *pdev)
>
> platform_set_drvdata(pdev, priv);
>
> - return devm_mbox_controller_register(dev, &priv->mbox);
> + ret = devm_mbox_controller_register(dev, &priv->mbox);
> + if (ret) {
> + clk_disable_unprepare(priv->clk);
> + return ret;
> + }
> +
> + return 0;
> }
>
> static int imx_mu_remove(struct platform_device *pdev)
> --
> 2.17.1
Powered by blists - more mailing lists