mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hwrng: omap3-rom: Use pm_runtime_resume_and_get()
@ 2026-09-22  3:20 phucduc.bui
  0 siblings, 0 replies; only message in thread
From: phucduc.bui @ 2026-09-22  3:20 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu; +Cc: linux-crypto, linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle()
error handling pattern with pm_runtime_resume_and_get(), which already
does this internally.

No functional change.

Found by manual code inspection.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/char/hw_random/omap3-rom-rng.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/char/hw_random/omap3-rom-rng.c b/drivers/char/hw_random/omap3-rom-rng.c
index aa71f61c3dc9..0797add0d782 100644
--- a/drivers/char/hw_random/omap3-rom-rng.c
+++ b/drivers/char/hw_random/omap3-rom-rng.c
@@ -42,12 +42,9 @@ static int omap3_rom_rng_read(struct hwrng *rng, void *data, size_t max, bool w)
 
 	ddata = (struct omap_rom_rng *)rng->priv;
 
-	r = pm_runtime_get_sync(ddata->dev);
-	if (r < 0) {
-		pm_runtime_put_noidle(ddata->dev);
-
+	r = pm_runtime_resume_and_get(ddata->dev);
+	if (r < 0)
 		return r;
-	}
 
 	ptr = virt_to_phys(data);
 	r = ddata->rom_rng_call(ptr, 4, RNG_GEN_HW);
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-22  3:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22  3:20 [PATCH] hwrng: omap3-rom: Use pm_runtime_resume_and_get() phucduc.bui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®