Re: [PATCH v3 06/11] clk: tegra: remove EMC to MC clock mux in Tegra114

Stephen Boyd
2025-09-21T17:54:15Z

Quoting Svyatoslav Ryhel (2025-09-15 01:01:52)
> diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c
> index 8bde72aa5e68..6b3a140772c2 100644
> --- a/drivers/clk/tegra/clk-tegra114.c
> +++ b/drivers/clk/tegra/clk-tegra114.c
> @@ -1321,6 +1309,28 @@ static int tegra114_reset_deassert(unsigned long id)
> return 0;
> }
>
> +#ifdef CONFIG_TEGRA124_CLK_EMC
> +static struct clk *tegra114_clk_src_onecell_get(struct of_phandle_args *clkspec,
> + void *data)
> +{
> + struct clk_hw *hw;
> + struct clk *clk;
> +
> + clk = of_clk_src_onecell_get(clkspec, data);
> + if (IS_ERR(clk))
> + return clk;
> +
> + hw = __clk_get_hw(clk);

Can you just use of_clk_hw_onecell_get() instead? Then we don't need to
use __clk_get_hw(). Or is this whole function used to return a clk
pointer to something that isn't the clk framework?

> +
> + if (clkspec->args[0] == TEGRA114_CLK_EMC) {
> + if (!tegra124_clk_emc_driver_available(hw))
> + return ERR_PTR(-EPROBE_DEFER);
> + }
> +
> + return clk;