mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Biju <biju.das.au@gmail.com>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
	linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2] memory: renesas-rpc-if: Add suspend/resume support
Date: Fri, 10 Oct 2025 04:48:48 +0200	[thread overview]
Message-ID: <4f490516-20d8-485f-8e1a-a1fb8c23e526@kernel.org> (raw)
In-Reply-To: <20250923151437.287721-1-biju.das.jz@bp.renesas.com>

On 23/09/2025 17:14, Biju wrote:
>  	if (rpc->info->type == XSPI_RZ_G3E) {
> -		struct clk *spi_clk;
> -
> -		spi_clk = devm_clk_get_enabled(dev, "spix2");
> -		if (IS_ERR(spi_clk))
> -			return dev_err_probe(dev, PTR_ERR(spi_clk),
> +		rpc->spix2_clk = devm_clk_get_enabled(dev, "spix2");
> +		if (IS_ERR(rpc->spix2_clk))
> +			return dev_err_probe(dev, PTR_ERR(rpc->spix2_clk),
>  					     "cannot get enabled spix2 clk\n");
>  
> -		spi_clk = devm_clk_get_enabled(dev, "spi");
> -		if (IS_ERR(spi_clk))
> -			return dev_err_probe(dev, PTR_ERR(spi_clk),
> +		rpc->spi_clk = devm_clk_get_enabled(dev, "spi");
> +		if (IS_ERR(rpc->spi_clk))
> +			return dev_err_probe(dev, PTR_ERR(rpc->spi_clk),
>  					     "cannot get enabled spi clk\n");
>  	}
>  
> @@ -1063,6 +1063,44 @@ static void rpcif_remove(struct platform_device *pdev)
>  	platform_device_unregister(rpc->vdev);
>  }
>  
> +static int rpcif_suspend(struct device *dev)
> +{
> +	struct rpcif_priv *rpc = dev_get_drvdata(dev);
> +
> +	if (rpc->info->type == XSPI_RZ_G3E) {

clk are null in other case, so you can simplify it by dropping this if().

> +		clk_disable_unprepare(rpc->spi_clk);
> +		clk_disable_unprepare(rpc->spix2_clk);
> +	}
> +
> +	return 0;
> +}
> +
> +static int rpcif_resume(struct device *dev)
> +{
> +	struct rpcif_priv *rpc = dev_get_drvdata(dev);
> +
> +	if (rpc->info->type == XSPI_RZ_G3E) {


... which would save you one indentation here making it a bit more readable.

> +		int ret;
> +
> +		ret = clk_prepare_enable(rpc->spix2_clk);
> +		if (ret) {
> +			dev_err(dev, "failed to enable spix2 clock: %pe\n",
> +				ERR_PTR(ret));
> +			return ret;


Best regards,
Krzysztof

  reply	other threads:[~2025-10-10  2:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23 15:14 Biju
2025-10-10  2:48 ` Krzysztof Kozlowski [this message]
2025-10-19 18:06   ` Biju Das

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=4f490516-20d8-485f-8e1a-a1fb8c23e526@kernel.org \
    --to=krzk@kernel.org \
    --cc=biju.das.au@gmail.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®