[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190806064614.20294-1-Anson.Huang@nxp.com>
Date: Tue, 6 Aug 2019 14:46:13 +0800
From: Anson.Huang@....com
To: mturquette@...libre.com, sboyd@...nel.org, shawnguo@...nel.org,
s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
abel.vesa@....com, peng.fan@....com, leonard.crestez@....com,
ping.bai@....com, jun.li@....com, chen.fang@....com,
agx@...xcpu.org, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Linux-imx@....com
Subject: [PATCH 1/2] clk: imx8mm: Unregister clks when of_clk_add_provider failed
From: Anson Huang <Anson.Huang@....com>
When of_clk_add_provider failed, all clks should be unregistered.
Signed-off-by: Anson Huang <Anson.Huang@....com>
---
drivers/clk/imx/clk-imx8mm.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
index e494e99..49ad761 100644
--- a/drivers/clk/imx/clk-imx8mm.c
+++ b/drivers/clk/imx/clk-imx8mm.c
@@ -661,12 +661,17 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
ret = of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
if (ret < 0) {
pr_err("failed to register clks for i.MX8MM\n");
- return -EINVAL;
+ goto unregister_clks;
}
imx_register_uart_clocks(uart_clks);
return 0;
+
+unregister_clks:
+ imx_unregister_clocks(clks, ARRAY_SIZE(clks));
+
+ return ret;
}
static const struct of_device_id imx8mm_clk_of_match[] = {
--
2.7.4
Powered by blists - more mailing lists