Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Maxime Ripard <maxime.ripard@anandra.org>
To: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: herbert@gondor.apana.org.au, linux-sunxi@googlegroups.com,
	linux-kernel@vger.kernel.org, Maxime Ripard <mripard@kernel.org>,
	Chen-Yu Tsai <wens@csie.org>,
	linux-crypto@vger.kernel.org, davem@davemloft.net,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] crypto: sun4i-ss: simplify enable/disable of the device
Date: Thu, 12 Sep 2019 08:32:19 +0200
Message-ID: <CAO4ZVTPAX8FsSWHNAbCV3XSEe5BjDM+s9cB_TbF-2t8g-u4TKQ@mail.gmail.com> (raw)
In-Reply-To: <20190911114650.20567-2-clabbe.montjoie@gmail.com>

Hi,

Le mer. 11 sept. 2019 à 13:46, Corentin Labbe
<clabbe.montjoie@gmail.com> a écrit :
>
> This patch regroups resource enabling/disabling in dedicated function.
> This simplify error handling and will permit to support power
> management.
>
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> ---
>  drivers/crypto/sunxi-ss/sun4i-ss-core.c | 73 ++++++++++++++-----------
>  1 file changed, 42 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-core.c b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
> index 9aa6fe081a27..2c9ff01dddfc 100644
> --- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c
> +++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
> @@ -223,6 +223,41 @@ static struct sun4i_ss_alg_template ss_algs[] = {
>  #endif
>  };
>
> +static void sun4i_ss_disable(struct sun4i_ss_ctx *ss)
> +{
> +       if (ss->reset)
> +               reset_control_assert(ss->reset);
> +       clk_disable_unprepare(ss->ssclk);
> +       clk_disable_unprepare(ss->busclk);
> +}

While you're at it, can you add a new line after the reset_control_assert here?

> +static int sun4i_ss_enable(struct sun4i_ss_ctx *ss)
> +{
> +       int err;
> +
> +       err = clk_prepare_enable(ss->busclk);
> +       if (err) {
> +               dev_err(ss->dev, "Cannot prepare_enable busclk\n");
> +               goto err_enable;
> +       }
> +       err = clk_prepare_enable(ss->ssclk);
> +       if (err) {
> +               dev_err(ss->dev, "Cannot prepare_enable ssclk\n");
> +               goto err_enable;
> +       }
> +       if (ss->reset) {
> +               err = reset_control_deassert(ss->reset);
> +               if (err) {
> +                       dev_err(ss->dev, "Cannot deassert reset control\n");
> +                       goto err_enable;
> +               }
> +       }
> +       return err;

And after each block here?

With that fixed:
Acked-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 11:46 [PATCH 0/2] crypto: sun4i-ss: Enable power management Corentin Labbe
2019-09-11 11:46 ` [PATCH 1/2] crypto: sun4i-ss: simplify enable/disable of the device Corentin Labbe
2019-09-12  6:32   ` Maxime Ripard [this message]
2019-09-11 11:46 ` [PATCH 2/2] crypto: sun4i-ss: enable pm_runtime Corentin Labbe
2019-09-12  6:35   ` Maxime Ripard
2019-09-12  8:49     ` Corentin Labbe

Reply instructions:

You may reply publically 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=CAO4ZVTPAX8FsSWHNAbCV3XSEe5BjDM+s9cB_TbF-2t8g-u4TKQ@mail.gmail.com \
    --to=maxime.ripard@anandra.org \
    --cc=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=mripard@kernel.org \
    --cc=wens@csie.org \
    /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

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git