From a41e3dc4060cca2599afa14fbd4c745763746ba8 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Mon, 4 Feb 2008 22:30:13 -0800 Subject: HWRNG: add possibility to remove hwrng devices during suspend/resume Make it possible to unregister a Hardware Random Number Generator device object in a safe way during a suspend/resume cycle. Signed-off-by: Rafael J. Wysocki Acked-by: Michael Buesch Cc: Michael Buesch Cc: Pavel Machek Cc: "John W. Linville" Cc: Alan Stern Cc: Len Brown Cc: Greg KH Cc: Kay Sievers Cc: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/hw_random.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include/linux/hw_random.h') diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index 85d11916e9ea..42131820bb89 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h @@ -44,7 +44,15 @@ struct hwrng { /** Register a new Hardware Random Number Generator driver. */ extern int hwrng_register(struct hwrng *rng); /** Unregister a Hardware Random Number Generator driver. */ -extern void hwrng_unregister(struct hwrng *rng); +extern void __hwrng_unregister(struct hwrng *rng, bool suspended); +static inline void hwrng_unregister(struct hwrng *rng) +{ + __hwrng_unregister(rng, false); +} +static inline void hwrng_unregister_suspended(struct hwrng *rng) +{ + __hwrng_unregister(rng, true); +} #endif /* __KERNEL__ */ #endif /* LINUX_HWRANDOM_H_ */ -- cgit v1.2.3-59-g8ed1b