2022-08-02 07:54:36

by CGEL

[permalink] [raw]
Subject: [PATCH linux-next] crypto: sun8i-ce:using the pm_runtime_resume_and_get to simplify the code

From: ye xingchen <[email protected]>

Using pm_runtime_resume_and_get() to instade of pm_runtime_get_sync
and pm_runtime_put_noidle.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: ye xingchen <[email protected]>
---
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
index 19cd2e52f89d..ef9cfc61af32 100644
--- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
+++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
@@ -54,9 +54,8 @@ static int sun8i_ce_trng_read(struct hwrng *rng, void *data, size_t max, bool wa
goto err_dst;
}

- err = pm_runtime_get_sync(ce->dev);
+ err = pm_runtime_resume_and_get(ce->dev);
if (err < 0) {
- pm_runtime_put_noidle(ce->dev);
goto err_pm;
}

--
2.25.1


2022-08-14 10:15:28

by Jernej Škrabec

[permalink] [raw]
Subject: Re: [PATCH linux-next] crypto: sun8i-ce:using the pm_runtime_resume_and_get to simplify the code

Dne torek, 02. avgust 2022 ob 09:48:20 CEST je [email protected] napisal(a):
> From: ye xingchen <[email protected]>
>
> Using pm_runtime_resume_and_get() to instade of pm_runtime_get_sync
> and pm_runtime_put_noidle.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: ye xingchen <[email protected]>
> ---
> drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
> b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c index
> 19cd2e52f89d..ef9cfc61af32 100644
> --- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
> +++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
> @@ -54,9 +54,8 @@ static int sun8i_ce_trng_read(struct hwrng *rng, void
> *data, size_t max, bool wa goto err_dst;
> }
>
> - err = pm_runtime_get_sync(ce->dev);
> + err = pm_runtime_resume_and_get(ce->dev);
> if (err < 0) {
> - pm_runtime_put_noidle(ce->dev);
> goto err_pm;
> }

You should also remove braces, since there is only one line left.

With that fixed:
Acked-by: Jernej Skrabec <[email protected]>

Best regards,
Jernej



2022-08-19 11:07:02

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH linux-next] crypto: sun8i-ce:using the pm_runtime_resume_and_get to simplify the code

[email protected] wrote:
> From: ye xingchen <[email protected]>
>
> Using pm_runtime_resume_and_get() to instade of pm_runtime_get_sync
> and pm_runtime_put_noidle.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: ye xingchen <[email protected]>
> ---
> drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt