diff mbox series

[-next] hwrng: omap - Using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Message ID 20210601144914.125679-1-zhangqilong3@huawei.com
State New
Headers show
Series [-next] hwrng: omap - Using pm_runtime_resume_and_get instead of pm_runtime_get_sync | expand

Commit Message

Zhang Qilong June 1, 2021, 2:49 p.m. UTC
Using 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: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/char/hw_random/omap-rng.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Herbert Xu June 11, 2021, 7:03 a.m. UTC | #1
On Tue, Jun 01, 2021 at 10:49:14PM +0800, Zhang Qilong wrote:
> Using 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: Zhang Qilong <zhangqilong3@huawei.com>

> ---

>  drivers/char/hw_random/omap-rng.c | 6 ++----

>  1 file changed, 2 insertions(+), 4 deletions(-)


This patch doesn't apply against the current cryptodev tree.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff mbox series

Patch

diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index cede9f159102..00ff96703dd2 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -454,10 +454,9 @@  static int omap_rng_probe(struct platform_device *pdev)
 	}
 
 	pm_runtime_enable(&pdev->dev);
-	ret = pm_runtime_get_sync(&pdev->dev);
+	ret = pm_runtime_resume_and_get(&pdev->dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to runtime_get device: %d\n", ret);
-		pm_runtime_put_noidle(&pdev->dev);
 		goto err_ioremap;
 	}
 
@@ -543,10 +542,9 @@  static int __maybe_unused omap_rng_resume(struct device *dev)
 	struct omap_rng_dev *priv = dev_get_drvdata(dev);
 	int ret;
 
-	ret = pm_runtime_get_sync(dev);
+	ret = pm_runtime_resume_and_get(dev);
 	if (ret < 0) {
 		dev_err(dev, "Failed to runtime_get device: %d\n", ret);
-		pm_runtime_put_noidle(dev);
 		return ret;
 	}