diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-03-12 14:00:02 -0700 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-03-16 21:45:54 +1100 |
commit | 4d9b519c9bcab5718053f8717dadad7b09b41f5e (patch) | |
tree | dec88fa5ec5272ebfd5886e0edabb612fa0a2154 /include/linux/hw_random.h | |
parent | 05713ba9055f1a209d50e480626f36c401bda3ad (diff) | |
download | linux-4d9b519c9bcab5718053f8717dadad7b09b41f5e.tar.gz linux-4d9b519c9bcab5718053f8717dadad7b09b41f5e.tar.bz2 linux-4d9b519c9bcab5718053f8717dadad7b09b41f5e.zip |
hwrng: add devm_* interfaces
This change adds devm_hwrng_register and devm_hwrng_unregister which
use can simplify error unwinding and unbinding code paths in device
drivers.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/hw_random.h')
-rw-r--r-- | include/linux/hw_random.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index eb7b414d232b..4f7d8f4b1e9a 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h @@ -50,10 +50,14 @@ struct hwrng { struct completion cleanup_done; }; +struct device; + /** Register a new Hardware Random Number Generator driver. */ extern int hwrng_register(struct hwrng *rng); +extern int devm_hwrng_register(struct device *dev, struct hwrng *rng); /** Unregister a Hardware Random Number Generator driver. */ extern void hwrng_unregister(struct hwrng *rng); +extern void devm_hwrng_unregister(struct device *dve, struct hwrng *rng); /** Feed random bits into the pool. */ extern void add_hwgenerator_randomness(const char *buffer, size_t count, size_t entropy); |