2021-05-24 11:55:02

by Tian Tao

[permalink] [raw]
Subject: [PATCH v2] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding

use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle. this change is just to simplify the code, no
actual functional changes.

Signed-off-by: Tian Tao <[email protected]>
---
v2: drop unnecessary change about if condition.
---
drivers/char/hw_random/exynos-trng.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c
index c8db62b..9cc3d54 100644
--- a/drivers/char/hw_random/exynos-trng.c
+++ b/drivers/char/hw_random/exynos-trng.c
@@ -196,10 +196,9 @@ static int __maybe_unused exynos_trng_resume(struct device *dev)
{
int ret;

- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(dev, "Could not get runtime PM.\n");
- pm_runtime_put_noidle(dev);
return ret;
}

--
2.7.4


2021-05-25 11:26:02

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding

On 24/05/2021 07:53, Tian Tao wrote:
> use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
> pm_runtime_put_noidle. this change is just to simplify the code, no
> actual functional changes.
>
> Signed-off-by: Tian Tao <[email protected]>
> ---
> v2: drop unnecessary change about if condition.
> ---
> drivers/char/hw_random/exynos-trng.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>


Reviewed-by: Krzysztof Kozlowski <[email protected]>


Best regards,
Krzysztof

2021-05-25 14:45:01

by Łukasz Stelmach

[permalink] [raw]
Subject: Re: [PATCH v2] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding

It was <2021-05-24 pon 19:53>, when Tian Tao wrote:
> use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
> pm_runtime_put_noidle. this change is just to simplify the code, no
> actual functional changes.
>
> Signed-off-by: Tian Tao <[email protected]>
> ---
> v2: drop unnecessary change about if condition.
> ---
> drivers/char/hw_random/exynos-trng.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>

Acked-by: Łukasz Stelmach <[email protected]>

> diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c
> index c8db62b..9cc3d54 100644
> --- a/drivers/char/hw_random/exynos-trng.c
> +++ b/drivers/char/hw_random/exynos-trng.c
> @@ -196,10 +196,9 @@ static int __maybe_unused exynos_trng_resume(struct device *dev)
> {
> int ret;
>
> - ret = pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> if (ret < 0) {
> dev_err(dev, "Could not get runtime PM.\n");
> - pm_runtime_put_noidle(dev);
> return ret;
> }

--
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics


Attachments:
signature.asc (497.00 B)

2021-06-03 12:31:31

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH v2] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding

Tian Tao <[email protected]> wrote:
> use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
> pm_runtime_put_noidle. this change is just to simplify the code, no
> actual functional changes.
>
> Signed-off-by: Tian Tao <[email protected]>
> ---
> v2: drop unnecessary change about if condition.
> ---
> drivers/char/hw_random/exynos-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