From a7ea3d63e89712c6c167595370eb42674e56b5bc Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Tue, 6 Oct 2026 22:27:34 +0200 Subject: hwrng: cctrng - simplify cctrng_probe() Handle the error directly and drop the goto statement. Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu --- drivers/char/hw_random/cctrng.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c index be35f058f37a..03401ee59a8e 100644 --- a/drivers/char/hw_random/cctrng.c +++ b/drivers/char/hw_random/cctrng.c @@ -534,7 +534,8 @@ static int cctrng_probe(struct platform_device *pdev) rc = devm_hwrng_register(dev, &drvdata->rng); if (rc) { dev_err(dev, "Could not register hwrng device.\n"); - goto post_pm_err; + cc_trng_pm_fini(drvdata); + return rc; } /* trigger HW to start generate data */ @@ -547,11 +548,6 @@ static int cctrng_probe(struct platform_device *pdev) dev_info(dev, "ARM cctrng device initialized\n"); return 0; - -post_pm_err: - cc_trng_pm_fini(drvdata); - - return rc; } static void cctrng_remove(struct platform_device *pdev) -- cgit v1.2.3