linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@anandra.org>
To: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: davem@davemloft.net, herbert@gondor.apana.org.au,
	Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-sunxi@googlegroups.com
Subject: Re: [PATCH 1/2] crypto: sun4i-ss: simplify enable/disable of the device
Date: Thu, 12 Sep 2019 08:32:19 +0200	[thread overview]
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

  reply	other threads:[~2019-09-12  6:32 UTC|newest]

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 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=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
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;
as well as URLs for NNTP newsgroup(s).