Re: [PATCH v4 2/3] clk: canaan: Add clock driver for Canaan K230

Xukai Wang
2025-02-20T15:18:39Z

On 2025/2/20 23:07, Xukai Wang wrote:
> On 2025/2/19 05:48, Stephen Boyd wrote:
>>> +static void k230_clk_disable(struct clk_hw *hw)
>>> +{
>>> + struct k230_clk *clk = to_k230_clk(hw);
>>> + struct k230_sysclk *ksc = clk->ksc;
>>> + struct k230_clk_cfg *cfg = &k230_clk_cfgs[clk->id];
>>> + u32 reg;
>>> +
>>> + if (!cfg->have_gate) {
>>> + dev_err(&ksc->pdev->dev, "This clock doesn't have gate\n");
>> Why are the clk_ops assigned to this clk then?
> If this clock doesn't have a gate, then the clk_ops will not be assigned to it. In this case, I'm simply checking it again. You can verify this in the k230_register_clk function to ensure it's handled correctly.
Apologies for my script doesn't wrap this paragraph.
> If you think this check is redundant, I can drop it.