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
  2026-10-02  8:22 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* Re: [PATCH] hwrng: omap3-rom: Use pm_runtime_resume_and_get()
  2026-09-22  3:20 [PATCH] hwrng: omap3-rom: Use pm_runtime_resume_and_get() phucduc.bui
@ 2026-10-02  8:22 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2026-10-02  8:22 UTC (permalink / raw)
  To: phucduc.bui; +Cc: Olivia Mackall, linux-crypto, linux-kernel

On Tue, Sep 22, 2026 at 10:20:54AM +0700, phucduc.bui@gmail.com wrote:
> 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(-)

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-02  8:22 UTC | newest]

Thread overview: 2+ messages (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
2026-10-02  8:22 ` Herbert Xu

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®