All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@nabladev.com>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>,
	Pavel Machek <pavel@nabladev.com>,
	Biju Das <biju.das.jz@bp.renesas.com>
Subject: Re: [PATCH 6.12.y-cip 2/8] clk: renesas: r9a09g077: Add xSPI core and module clocks
Date: Thu, 16 Jul 2026 12:48:15 +0200	[thread overview]
Message-ID: <ali274E3aNG2-Rtx@duo.ucw.cz> (raw)
In-Reply-To: <20260706182328.5237-3-prabhakar.mahadev-lad.rj@bp.renesas.com>

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

Hi!

Minor details here:

> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> [PL: manually applied the changes]
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

> +++ b/drivers/clk/renesas/r9a09g077-cpg.c
> @@ -295,6 +334,151 @@ r9a09g077_cpg_mux_clk_register(struct device *dev,
>  	return clk_hw->clk;
>  }
>  
> +static unsigned int r9a09g077_cpg_fselxspi_get_divider(struct clk_hw *hw, unsigned long rate,
> +						       unsigned int num_parents)
> +{
> +	struct clk_fixed_factor *ff;
> +	struct clk_hw *parent_hw;
> +	unsigned long best_rate;
> +	unsigned int i;
> +
> +	for (i = 0; i < num_parents; i++) {
> +		parent_hw = clk_hw_get_parent_by_index(hw, i);
> +		best_rate = clk_hw_round_rate(parent_hw, rate);
> +
> +		if (best_rate == rate) {
> +			ff = to_clk_fixed_factor(parent_hw);
> +			return ff->div;
> +		}
> +	}
> +
> +	/* No parent could provide the exact rate - this should not happen */
> +	return 0;
> +}

If it can't happen, WARN() may be suitable?

> +
> +static struct clk * __init
> +r9a09g077_cpg_fselxspi_div_clk_register(struct device *dev,
> +					const struct cpg_core_clk *core,
> +					void __iomem *addr,
...
> +	if (!xspi_div_ops) {
> +		xspi_div_ops = devm_kzalloc(dev, sizeof(*xspi_div_ops), GFP_KERNEL);
> +		if (!xspi_div_ops)
> +			return  ERR_PTR(-ENOMEM);

One space would be enough between return and ERR.

> +		memcpy(xspi_div_ops, &clk_divider_ops,
> +		       sizeof(const struct clk_ops));

And the memcpy does fit on single line.

(May not be worth cleaning up unless you are doing changes for that anyway).

Thanks and best regards,
										Pavel

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

  reply	other threads:[~2026-07-16 10:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 18:23 [PATCH 6.12.y-cip 0/8] Add xSPI support to RZ/T2H and RZ/N2H SoCs Lad Prabhakar
2026-07-06 18:23 ` [PATCH 6.12.y-cip 1/8] mtd: spi-nor: add support for Macronix Octal flash Lad Prabhakar
2026-07-06 18:23 ` [PATCH 6.12.y-cip 2/8] clk: renesas: r9a09g077: Add xSPI core and module clocks Lad Prabhakar
2026-07-16 10:48   ` Pavel Machek [this message]
2026-07-06 18:23 ` [PATCH 6.12.y-cip 3/8] dt-bindings: memory: renesas,rzg3e-xspi: Add RZ/T2H and RZ/N2H support Lad Prabhakar
2026-07-06 18:23 ` [PATCH 6.12.y-cip 4/8] memory: renesas-rpc-if: Fix duplicate device name on multi-instance platforms Lad Prabhakar
2026-07-06 18:23 ` [PATCH 6.12.y-cip 5/8] memory: renesas-rpc-if: Add suspend/resume support Lad Prabhakar
2026-07-16 10:49   ` Pavel Machek
2026-07-06 18:23 ` [PATCH 6.12.y-cip 6/8] arm64: dts: renesas: r9a09g077: Add xSPI nodes Lad Prabhakar
2026-07-06 18:23 ` [PATCH 6.12.y-cip 7/8] arm64: dts: renesas: r9a09g087: " Lad Prabhakar
2026-07-06 18:23 ` [PATCH 6.12.y-cip 8/8] arm64: dts: renesas: rzt2h-n2h-evk: Enable " Lad Prabhakar
2026-07-16 10:50   ` Pavel Machek
2026-07-16  7:30 ` [PATCH 6.12.y-cip 0/8] Add xSPI support to RZ/T2H and RZ/N2H SoCs nobuhiro.iwamatsu.x90
2026-07-16 10:51   ` [cip-dev] " Pavel Machek

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=ali274E3aNG2-Rtx@duo.ucw.cz \
    --to=pavel@nabladev.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro.iwamatsu.x90@mail.toshiba \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.