Skip to contentSkip to conversation

hwrng: omap3-rom: Use pm_runtime_resume_and_get()

PATCH In review [email protected] 2 participants 2 messages Sep 22 – Oct 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwrng: omap3-rom: Use pm_runtime_resume_and_get()

From: bui duc phuc <[email protected]>

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.

---
 drivers/char/hw_random/omap3-rom-rng.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/char/hw_random/omap3-rom-rng.c +2 -5
index aa71f61c3dc9..0797add0d782 100644
@@ -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);
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 6 lines · On Tue, Sep 22, 2026 at 10:20:54AM +0700, [email protected] wrote:

From: bui duc phuc <[email protected]>

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.

Quoted 8 lines

No functional change.

Found by manual code inspection.

---
 drivers/char/hw_random/omap3-rom-rng.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 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