Skip to contentSkip to conversation

hwrng: exynos: Use pm_runtime_resume_and_get() to replace open coding

PATCH Superseded Tian Tao 4 participants 4 messages May 24, 2021 – Jun 3, 2021

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Tian Tao

author
#0 lore raw

PATCH v2 1/1 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.

---
v2: drop unnecessary change about if condition.

---
 drivers/char/hw_random/exynos-trng.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/hw_random/exynos-trng.c +1 -2
index c8db62b..9cc3d54 100644
@@ -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;
 	}
 
Signature · 1 line
2.7.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · 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.

---
v2: drop unnecessary change about if condition.

---
 drivers/char/hw_random/exynos-trng.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Best regards,
Krzysztof

maintainer Acked-by on v2 1/1
#2 lore raw
In reply to Tian Tao
Quoted 11 lines · when 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.

---
v2: drop unnecessary change about if condition.

---
 drivers/char/hw_random/exynos-trng.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 15 lines
drivers/char/hw_random/exynos-trng.c +1 -2
index c8db62b..9cc3d54 100644
@@ -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;
 	}
Signature · 3 lines
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics
maintainer
#3 lore raw
In reply to Tian Tao
Quoted 10 lines · 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.

---
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.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt