Move the apmixedsys compatible into the mt8516-clk of_match table and
drop its separate U_BOOT_DRIVER entry.

It was only kept apart because it used different clk_ops. Now that all
MediaTek clock drivers share mtk_clk_ops, its entry is identical to
mt8516-clk apart from the of_match table.

mtk_pll_early_init() looked the apmixedsys device up by its driver,
which would now also match the topckgen device, so look it up by its
compatible instead.

Signed-off-by: David Lechner <[email protected]>
---
 arch/arm/mach-mediatek/mt8516/init.c |  6 ++++--
 drivers/clk/mediatek/clk-mt8516.c    | 16 +---------------
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/arch/arm/mach-mediatek/mt8516/init.c 
b/arch/arm/mach-mediatek/mt8516/init.c
index d9fe8fc8505..99574c14822 100644
--- a/arch/arm/mach-mediatek/mt8516/init.c
+++ b/arch/arm/mach-mediatek/mt8516/init.c
@@ -16,6 +16,7 @@
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <asm/sections.h>
+#include <dm/ofnode.h>
 #include <dm/uclass.h>
 #include <dt-bindings/clock/mt8516-clk.h>
 
@@ -41,10 +42,11 @@ static int mtk_pll_early_init(void)
                [CLK_APMIXED_MMPLL] =     380000000,
        };
        struct udevice *dev;
+       ofnode node;
        int ret, i;
 
-       ret = uclass_get_device_by_driver(UCLASS_CLK,
-                       DM_DRIVER_GET(mt8516_clk_apmixedsys), &dev);
+       node = ofnode_by_compatible(ofnode_null(), 
"mediatek,mt8516-apmixedsys");
+       ret = uclass_get_device_by_ofnode(UCLASS_CLK, node, &dev);
        if (ret)
                return ret;
 
diff --git a/drivers/clk/mediatek/clk-mt8516.c 
b/drivers/clk/mediatek/clk-mt8516.c
index 6402fbb80f8..9f25f1dffcf 100644
--- a/drivers/clk/mediatek/clk-mt8516.c
+++ b/drivers/clk/mediatek/clk-mt8516.c
@@ -769,15 +769,11 @@ static const struct mtk_clk_tree mt8516_topckgen_clk_tree 
= {
 
 MTK_GATE_CLK_TREE(mt8516_clk_tree, top_clks, ext_clock_rates);
 
-static const struct udevice_id mt8516_apmixed_compat[] = {
+static const struct udevice_id mt8516_clk_compat[] = {
        {
                .compatible = "mediatek,mt8516-apmixedsys",
                .data = (ulong)&mt8516_apmixed_clk_tree,
        },
-       { }
-};
-
-static const struct udevice_id mt8516_clk_compat[] = {
        {
                .compatible = "mediatek,mt8516-topckgen",
                .data = (ulong)&mt8516_topckgen_clk_tree,
@@ -789,16 +785,6 @@ static const struct udevice_id mt8516_clk_compat[] = {
        { }
 };
 
-U_BOOT_DRIVER(mt8516_clk_apmixedsys) = {
-       .name = "mt8516-apmixedsys",
-       .id = UCLASS_CLK,
-       .of_match = mt8516_apmixed_compat,
-       .probe = mtk_clk_probe,
-       .priv_auto = sizeof(struct mtk_clk_priv),
-       .ops = &mtk_clk_ops,
-       .flags = DM_FLAG_PRE_RELOC,
-};
-
 U_BOOT_DRIVER(mt8516_clk) = {
        .name = "mt8516-clk",
        .id = UCLASS_CLK,

-- 
2.43.0

Reply via email to