linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwrng: mtk - handle devm_pm_runtime_enable errors
@ 2025-06-29 17:31 Ovidiu Panait
  2025-07-18 10:56 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Ovidiu Panait @ 2025-06-29 17:31 UTC (permalink / raw)
  To: sean.wang, olivia, herbert, matthias.bgg,
	angelogioacchino.delregno
  Cc: linux-crypto, linux-kernel, linux-arm-kernel, linux-mediatek,
	Ovidiu Panait

Although unlikely, devm_pm_runtime_enable() call might fail, so handle
the return value.

Fixes: 78cb66caa6ab ("hwrng: mtk - Use devm_pm_runtime_enable")
Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
---
 drivers/char/hw_random/mtk-rng.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/mtk-rng.c b/drivers/char/hw_random/mtk-rng.c
index b7fa1bc1122b..d09a4d813766 100644
--- a/drivers/char/hw_random/mtk-rng.c
+++ b/drivers/char/hw_random/mtk-rng.c
@@ -143,7 +143,9 @@ static int mtk_rng_probe(struct platform_device *pdev)
 	dev_set_drvdata(&pdev->dev, priv);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, RNG_AUTOSUSPEND_TIMEOUT);
 	pm_runtime_use_autosuspend(&pdev->dev);
-	devm_pm_runtime_enable(&pdev->dev);
+	ret = devm_pm_runtime_enable(&pdev->dev);
+	if (ret)
+		return ret;
 
 	dev_info(&pdev->dev, "registered RNG driver\n");
 
-- 
2.49.0


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

* Re: [PATCH] hwrng: mtk - handle devm_pm_runtime_enable errors
  2025-06-29 17:31 [PATCH] hwrng: mtk - handle devm_pm_runtime_enable errors Ovidiu Panait
@ 2025-07-18 10:56 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2025-07-18 10:56 UTC (permalink / raw)
  To: Ovidiu Panait
  Cc: sean.wang, olivia, matthias.bgg, angelogioacchino.delregno,
	linux-crypto, linux-kernel, linux-arm-kernel, linux-mediatek

On Sun, Jun 29, 2025 at 08:31:41PM +0300, Ovidiu Panait wrote:
> Although unlikely, devm_pm_runtime_enable() call might fail, so handle
> the return value.
> 
> Fixes: 78cb66caa6ab ("hwrng: mtk - Use devm_pm_runtime_enable")
> Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
> ---
>  drivers/char/hw_random/mtk-rng.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

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:[~2025-07-18 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-29 17:31 [PATCH] hwrng: mtk - handle devm_pm_runtime_enable errors Ovidiu Panait
2025-07-18 10:56 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).