@@ -1821,6 +1821,10 @@ static int spacemit_ccu_register(struct device *dev,
const struct spacemit_ccu_clk *clk;
int i, ret, max_id = 0;
+ /* Clocks are optional */
+ if (!clks)
+ return 0;
+
for (clk = clks; clk->hw; clk++)
max_id = max(max_id, clk->id);
@@ -1926,7 +1930,7 @@ static int k1_ccu_probe(struct platform_device *pdev)
return 0;
}
-/* The match data is required to be non-null, and have a non-null clk pointer */
+/* The match data is required, and its clk or reset_data field must not be null */
static const struct of_device_id of_k1_ccu_match[] = {
{
.compatible = "spacemit,k1-pll",
There are some syscon devices that support both clocks and resets, but for now only their reset functionality is required. Make defining clocks optional for a SpacemiT CCU, though at least one clock or at least one reset controller must be defined. Signed-off-by: Alex Elder <elder@riscstar.com> --- v2: - Comment explains constraints on match data drivers/clk/spacemit/ccu-k1.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)