* [PATCH] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding
@ 2021-05-21 3:58 Tian Tao
2021-05-21 11:24 ` Krzysztof Kozlowski
[not found] ` <CGME20210524083244eucas1p263470ad84270aa59c06432c92cf56280@eucas1p2.samsung.com>
0 siblings, 2 replies; 3+ messages in thread
From: Tian Tao @ 2021-05-21 3:58 UTC (permalink / raw)
To: l.stelmach, krzysztof.kozlowski; +Cc: linux-samsung-soc, linux-crypto, Tian Tao
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 <tiantao6@hisilicon.com>
---
drivers/char/hw_random/exynos-trng.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c
index 8e1fe3f..d71ef3c 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);
- if (ret < 0) {
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret) {
dev_err(dev, "Could not get runtime PM.\n");
- pm_runtime_put_noidle(dev);
return ret;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding
2021-05-21 3:58 [PATCH] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding Tian Tao
@ 2021-05-21 11:24 ` Krzysztof Kozlowski
[not found] ` <CGME20210524083244eucas1p263470ad84270aa59c06432c92cf56280@eucas1p2.samsung.com>
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2021-05-21 11:24 UTC (permalink / raw)
To: Tian Tao, l.stelmach; +Cc: linux-samsung-soc, linux-crypto
On 20/05/2021 23:58, 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 <tiantao6@hisilicon.com>
> ---
> drivers/char/hw_random/exynos-trng.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c
> index 8e1fe3f..d71ef3c 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);
> - if (ret < 0) {
> + ret = pm_runtime_resume_and_get(dev);
> + if (ret) {
> dev_err(dev, "Could not get runtime PM.\n");
> - pm_runtime_put_noidle(dev);
> return ret;
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding
[not found] ` <CGME20210524083244eucas1p263470ad84270aa59c06432c92cf56280@eucas1p2.samsung.com>
@ 2021-05-24 8:32 ` Lukasz Stelmach
0 siblings, 0 replies; 3+ messages in thread
From: Lukasz Stelmach @ 2021-05-24 8:32 UTC (permalink / raw)
To: Tian Tao; +Cc: krzysztof.kozlowski, linux-samsung-soc, linux-crypto
[-- Attachment #1: Type: text/plain, Size: 1171 bytes --]
It was <2021-05-21 pią 11:58>, 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 <tiantao6@hisilicon.com>
> ---
> drivers/char/hw_random/exynos-trng.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c
> index 8e1fe3f..d71ef3c 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);
> - if (ret < 0) {
> + ret = pm_runtime_resume_and_get(dev);
> + if (ret) {
pm_runtime_resume_and_get() (see include/linux/pm_runtime.h) checks for
ret < 0 and returns it, so I think it is better to keep (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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-24 8:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 3:58 [PATCH] hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding Tian Tao
2021-05-21 11:24 ` Krzysztof Kozlowski
[not found] ` <CGME20210524083244eucas1p263470ad84270aa59c06432c92cf56280@eucas1p2.samsung.com>
2021-05-24 8:32 ` Lukasz Stelmach
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.