public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Masney <bmasney@redhat.com>
To: "Miquel Raynal (Schneider Electric)" <miquel.raynal@bootlin.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	Olivia Mackall <olivia@selenic.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Jayesh Choudhary <j-choudhary@ti.com>,
	"David S. Miller" <davem@davemloft.net>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Antoine Tenart <atenart@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Pascal EBERHARD <pascal.eberhard@se.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 09/16] clk: Use the generic OF phandle parsing in only one place
Date: Mon, 30 Mar 2026 11:01:59 -0400	[thread overview]
Message-ID: <acqQZ5sx_WZrr4KJ@redhat.com> (raw)
In-Reply-To: <20260327-schneider-v7-0-rc1-crypto-v1-9-5e6ff7853994@bootlin.com>

On Fri, Mar 27, 2026 at 09:09:31PM +0100, Miquel Raynal (Schneider Electric) wrote:
> There should be one single entry in the OF world, so that the way we
> parse the DT is always the same. make sure this is the case by avoid
> calling of_parse_phandle_with_args() from of_clk_get_parent_name(). This
> is even more relevant as we currently fail to parse clock-ranges. As a
> result, it seems to be safer to directly call of_parse_clkspec() there.
> 
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
> ---
>  drivers/clk/clk.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 591c0780b61e..93e33ff30f3a 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -5375,8 +5375,7 @@ const char *of_clk_get_parent_name(const struct device_node *np, int index)
>  	int count;
>  	struct clk *clk;
>  
> -	rc = of_parse_phandle_with_args(np, "clocks", "#clock-cells", index,
> -					&clkspec);
> +	rc = of_parse_clkspec(np, index, NULL, &clkspec);
>  	if (rc)
>  		return NULL;

Reviewed-by: Brian Masney <bmasney@redhat.com>

In case a Fixes tag is warranted, it's not exactly clear what should be
used. This was introduced in commit 766e6a4ec602 ("clk: add DT clock
binding support") in 2012. However of_parse_clkspec was introduced in
commit 4472287a3b2f5 ("clk: Introduce of_clk_get_hw_from_clkspec()") in
2018.


  parent reply	other threads:[~2026-03-30 15:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260327-schneider-v7-0-rc1-crypto-v1-0-5e6ff7853994@bootlin.com>
     [not found] ` <20260327-schneider-v7-0-rc1-crypto-v1-12-5e6ff7853994@bootlin.com>
2026-03-28 13:10   ` [PATCH 12/16] irqchip/eip201-aic: Add support for Safexcel EIP-201 AIC Thomas Gleixner
2026-04-01  9:10     ` Miquel Raynal
2026-03-30 13:33 ` [PATCH 00/16] Add support for Inside-Secure EIP-150 crypto block Geert Uytterhoeven
2026-04-01  9:02   ` Miquel Raynal
     [not found] ` <20260327-schneider-v7-0-rc1-crypto-v1-6-5e6ff7853994@bootlin.com>
2026-03-30 14:48   ` [PATCH 06/16] clk: tests: Add clk_parse_clkspec() Kunit testing Brian Masney
2026-04-01  8:59     ` Miquel Raynal
2026-04-01 13:55       ` Brian Masney
     [not found] ` <20260327-schneider-v7-0-rc1-crypto-v1-8-5e6ff7853994@bootlin.com>
2026-03-30 14:50   ` [PATCH 08/16] clk: Improve a couple of comments Brian Masney
     [not found] ` <20260327-schneider-v7-0-rc1-crypto-v1-9-5e6ff7853994@bootlin.com>
2026-03-30 15:01   ` Brian Masney [this message]
2026-04-01  8:49     ` [PATCH 09/16] clk: Use the generic OF phandle parsing in only one place Miquel Raynal
     [not found] ` <20260327-schneider-v7-0-rc1-crypto-v1-10-5e6ff7853994@bootlin.com>
2026-03-30 15:09   ` [PATCH 10/16] clk: Add support for clock nexus dt bindings Brian Masney
2026-03-30 15:16   ` Brian Masney
2026-04-01  8:47     ` Miquel Raynal
2026-04-01 14:04       ` Brian Masney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acqQZ5sx_WZrr4KJ@redhat.com \
    --to=bmasney@redhat.com \
    --cc=ansuelsmth@gmail.com \
    --cc=atenart@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=herbert@gondor.apana.org.au \
    --cc=j-choudhary@ti.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mturquette@baylibre.com \
    --cc=olivia@selenic.com \
    --cc=pascal.eberhard@se.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox