> Replace the apmixedsys, topckgen and infrasys of_xlate callbacks with a
> single mtk_clk_of_xlate() that accepts an ID if it belongs to any of
> the tables of the clock tree.
>
> The three callbacks only differed in which clock types they accepted,
> but each mtk_clk_id_is_*() check already requires the matching table to
> be defined, so the tree contents do that filtering by themselves. No
> tree using the apmixedsys ops defines fixed clocks, fixed factors or
> muxes, none using the topckgen ops defines PLLs, and none using the
> infrasys ops defines PLLs or fixed clocks, so this is no functional
> change.
>
> Signed-off-by: David Lechner <[email protected]>
>
> diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
> index 78ce206197d..d93c19c74db 100644
> --- a/drivers/clk/mediatek/clk-mtk.c
> +++ b/drivers/clk/mediatek/clk-mtk.c
> @@ -177,6 +177,24 @@ static bool mtk_clk_id_is_gate(const struct mtk_clk_tree 
> *tree, int mapped_id)
>              mapped_id < tree->gates_offs + tree->num_gates;
>  }
>
> +static int mtk_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args 
> *args)

Nit: Here we drop the const qualifier present on all other xlate
callbacks. Since const on an integer return type is useless, maybe add a
comment explaining why it is intentionally dropped?

-- 
Julien Stephan <[email protected]>

Reply via email to