hwrng: bcm63xx - make use of devm_hwrng_register
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 12 Mar 2015 21:00:03 +0000 (14:00 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 16 Mar 2015 10:45:54 +0000 (21:45 +1100)
commit6229c16060fee9a015bf476f21e40c6f08609d6e
treef622339bdb716ccac71bdd0015879d1900faf663
parent4d9b519c9bcab5718053f8717dadad7b09b41f5e
hwrng: bcm63xx - make use of devm_hwrng_register

This change converts bcm63xx-rng to use devm* API for managing all
resources, which allows us to dispense with the rest of error handling
path and remove() function. Also we combine hwern and driver-private
data into a single allocation, use clk_prepare_enable() instead
of "naked" clk_enable() and move clock enabling/disabling into hwrnd
inti(0 and cleanup() methods so the clock stays off until rng is
used.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/bcm63xx-rng.c