Thread (3 messages) 3 messages, 3 authors, 2019-06-25

Re: [PATCH] clk: imx8mm: Switch to platform driver

From: Stephen Boyd <sboyd@kernel.org>
Date: 2019-06-25 20:39:44
Also in: linux-clk, lkml

Quoting Abel Vesa (2019-06-24 03:54:32)
In order to make the clock provider a platform driver
all the data and code needs to be outside of .init section.
Yes, but why are you making this change in general?
Signed-off-by: Abel Vesa <redacted>
[...]
quoted hunk ↗ jump to hunk
@@ -480,7 +481,7 @@ static int __init imx8mm_clocks_init(struct device_node *ccm_node)
        clks[IMX8MM_SYS_PLL2_500M] = imx_clk_fixed_factor("sys_pll2_500m", "sys_pll2_out", 1, 2);
        clks[IMX8MM_SYS_PLL2_1000M] = imx_clk_fixed_factor("sys_pll2_1000m", "sys_pll2_out", 1, 1);
 
-       np = ccm_node;
+       np = dev->of_node;
        base = of_iomap(np, 0);
If we're using platform device here it would be nice to also use
platform device APIs to map memory and request resources, etc.
quoted hunk ↗ jump to hunk
        if (WARN_ON(!base))
                return -ENOMEM;
@@ -682,4 +683,19 @@ static int __init imx8mm_clocks_init(struct device_node *ccm_node)
 
        return 0;
 }
-CLK_OF_DECLARE_DRIVER(imx8mm, "fsl,imx8mm-ccm", imx8mm_clocks_init);
+
+static const struct of_device_id imx8mm_clk_of_match[] = {
+       { .compatible = "fsl,imx8mm-ccm" },
+       { /* Sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, imx8mm_clk_of_match);
+
+
Nitpick: Drop the second newline.
+static struct platform_driver imx8mm_clk_driver = {
+       .probe = imx8mm_clocks_probe,
+       .driver = {
+               .name = "imx8mm-ccm",
+               .of_match_table = of_match_ptr(imx8mm_clk_of_match),
+       },
+};
+module_platform_driver(imx8mm_clk_driver);
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help