Skip to contentSkip to conversation

hwrng: cctrng - simplify cctrng_probe()

PATCH In review Thorsten Blum 2 participants 2 messages Oct 6 – Oct 15

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

PATCH 1/1 hwrng: cctrng - simplify cctrng_probe()

Handle the error directly and drop the goto statement.

---
 drivers/char/hw_random/cctrng.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/char/hw_random/cctrng.c +2 -6
index a6925211c3b5..43bf99741bdf 100644
@@ -539,7 +539,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 */
@@ -552,11 +553,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)
maintainer
#1 lore raw
Quoted 6 lines · Thorsten Blum

Handle the error directly and drop the goto statement.

---
 drivers/char/hw_random/cctrng.c | 8 ++------
 1 file changed, 2 insertions(+), 6 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