@@ -615,10 +615,10 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
imx_check_clk_hws(hws, IMX8MM_CLK_END);
- ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_hw_data);
+ ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data);
if (ret < 0) {
dev_err(dev, "failed to register clks for i.MX8MM\n");
- goto unregister_hws;
+ return ret;
}
for (i = 0; i < ARRAY_SIZE(uart_clk_ids); i++) {
@@ -630,11 +630,6 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
imx_register_uart_clocks(uart_hws);
return 0;
-
-unregister_hws:
- imx_unregister_hw_clocks(hws, IMX8MM_CLK_END);
-
- return ret;
}
static const struct of_device_id imx8mm_clk_of_match[] = {
@@ -562,10 +562,10 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
imx_check_clk_hws(hws, IMX8MN_CLK_END);
- ret = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_hw_data);
+ ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data);
if (ret < 0) {
dev_err(dev, "failed to register hws for i.MX8MN\n");
- goto unregister_hws;
+ return ret;
}
for (i = 0; i < ARRAY_SIZE(uart_clk_ids); i++) {
@@ -577,11 +577,6 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)
imx_register_uart_clocks(uart_hws);
return 0;
-
-unregister_hws:
- imx_unregister_hw_clocks(hws, IMX8MN_CLK_END);
-
- return ret;
}
static const struct of_device_id imx8mn_clk_of_match[] = {
@@ -432,7 +432,7 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
void __iomem *anatop_base, *ccm_base;
- int i;
+ int ret, i;
np = of_find_compatible_node(NULL, NULL, "fsl,imx8mp-anatop");
anatop_base = of_iomap(np, 0);
@@ -741,7 +741,11 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)
imx_check_clk_hws(hws, IMX8MP_CLK_END);
- of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_hw_data);
+ ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data);
+ if (ret < 0) {
+ dev_err(dev, "failed to register hws for i.MX8MN\n");
+ return ret;
+ }
for (i = 0; i < ARRAY_SIZE(uart_clk_ids); i++) {
int index = uart_clk_ids[i];
@@ -600,10 +600,10 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
imx_check_clk_hws(hws, IMX8MQ_CLK_END);
- err = of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_hw_data);
+ err = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data);
if (err < 0) {
dev_err(dev, "failed to register hws for i.MX8MQ\n");
- goto unregister_hws;
+ return err;
}
for (i = 0; i < ARRAY_SIZE(uart_clk_ids); i++) {
@@ -615,11 +615,6 @@ static int imx8mq_clocks_probe(struct platform_device *pdev)
imx_register_uart_clocks(uart_hws);
return 0;
-
-unregister_hws:
- imx_unregister_hw_clocks(hws, IMX8MQ_CLK_END);
-
- return err;
}
static const struct of_device_id imx8mq_clk_of_match[] = {