summaryrefslogtreecommitdiff
path: root/include/linux/hw_random.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-03-13 00:00:02 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2015-03-16 13:45:54 +0300
commit4d9b519c9bcab5718053f8717dadad7b09b41f5e (patch)
treedec88fa5ec5272ebfd5886e0edabb612fa0a2154 /include/linux/hw_random.h
parent05713ba9055f1a209d50e480626f36c401bda3ad (diff)
downloadlinux-4d9b519c9bcab5718053f8717dadad7b09b41f5e.tar.xz
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.h4
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);