Re: [PATCH v2 2/2] Add clock driver for Unisoc SC9832E SoC.
From: Stephen Boyd <sboyd@kernel.org>
Date: 2026-01-23 18:50:32
Also in:
linux-clk, lkml
Quoting Nadi Ke (2026-01-21 00:14:12)
quoted hunk ↗ jump to hunk
diff --git a/drivers/clk/sprd/sc9832e-clk.c b/drivers/clk/sprd/sc9832e-clk.c new file mode 100644 index 000000000..0574097b0 --- /dev/null +++ b/drivers/clk/sprd/sc9832e-clk.c@@ -0,0 +1,1077 @@
[...]
+};
+
+static const struct of_device_id sprd_sc9832e_clk_ids[] = {
+ { .compatible = "sprd,sc9832e-glbregs", /* 0x402b0000 */
+ .data = &sc9832e_pmu_gate_desc },
+ { .compatible = "sprd,sc9832e-pll", /* 0x403c0000 */
+ .data = &sc9832e_pll_desc },
+ { .compatible = "sprd,sc9832e-mpll", /* 0x403f0000 */
+ .data = &sc9832e_mpll_desc },
+ { .compatible = "sprd,sc9832e-dpll", /* 0x403d0000 */
+ .data = &sc9832e_dpll_desc },
+ { .compatible = "sprd,sc9832e-rpll", /* 0x40410000 */
+ .data = &sc9832e_rpll_desc },
+ { .compatible = "sprd,sc9832e-apahb-gate", /* 0x20e00000 */
+ .data = &sc9832e_apahb_gate_desc },
+ { .compatible = "sprd,sc9832e-aonapb-gate", /* 0x402e0000 */
+ .data = &sc9832e_aonapb_gate_desc },
+ { .compatible = "sprd,sc9832e-ap-clk", /* 0x21500000 */
+ .data = &sc9832e_ap_clk_desc },
+ { .compatible = "sprd,sc9832e-aon-clk", /* 0x402d0000 */
+ .data = &sc9832e_aon_clk_desc },
+ { .compatible = "sprd,sc9832e-apapb-gate", /* 0x71300000 */
+ .data = &sc9832e_apapb_gate_desc },
+ { }
+};
+MODULE_DEVICE_TABLE(of, sprd_sc9832e_clk_ids);Please move this after probe next to the driver structure.
+
+static int sc9832e_clk_probe(struct platform_device *pdev)
+{
+ const struct of_device_id *match;
+ const struct sprd_clk_desc *desc;
+ int ret;
+
+ match = of_match_node(sprd_sc9832e_clk_ids, pdev->dev.of_node);Use device_get_match_data()
+ if (!match) + return -ENODEV; + + desc = match->data; +