hwrng: cctrng - simplify cctrng_probe()
Subsystems (3)
PATCH 1/1 hwrng: cctrng - simplify cctrng_probe()
Handle the error directly and drop the goto statement.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/char/hw_random/cctrng.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/char/hw_random/cctrng.c +2 -6
@@ -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)
Herbert Xu
maintainerQuoted 6 lines · Thorsten Blum
Handle the error directly and drop the goto statement.
Signed-off-by Thorsten Blum <[email protected]>--- 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