Re: [PATCH 6.1.y-cip 08/85] clk: renesas: rzv2h: Add selective Runtime PM support for clocks

Pavel Machek
2025-03-20T08:59:07Z

[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]

Hi!

> +static bool rzv2h_cpg_is_pm_clk(struct rzv2h_cpg_pd *pd,
> + const struct of_phandle_args *clkspec)
> +{
> + if (clkspec->np != pd->genpd.dev.of_node || clkspec->args_count != 2)
> + return false;
> +
> + switch (clkspec->args[0]) {
> + case CPG_MOD: {
> + struct rzv2h_cpg_priv *priv = pd->priv;
> + unsigned int id = clkspec->args[1];
> + struct mod_clock *clock;
> +
> + if (id >= priv->num_mod_clks)
> + return false;
> +
> + if (priv->clks[priv->num_core_clks + id] == ERR_PTR(-ENOENT))
> + return false;
> +
> + clock = to_mod_clock(__clk_get_hw(priv->clks[priv->num_core_clks + id]));
> +
> + return !clock->no_pm;
> + }
> +
> + case CPG_CORE:
> + default:
> + return false;
> + }
> +}

Are there more entries likely to be added to the switch? If not, I
guess this should be

if (clkspec->args[0] != CPG_MOD)
return false;

and then getting rid of the switch.

Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]