aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hw_random.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-02-05 01:30:13 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:23 -0500
commita41e3dc4060cca2599afa14fbd4c745763746ba8 (patch)
treec97d189602b6564054f348dbfc2c865baafecd96 /include/linux/hw_random.h
parent533354d4ac48b7df99f18f952e5d51c3f59ba56c (diff)
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 <rjw@sisk.pl> Acked-by: Michael Buesch <mb@bu3sch.de> Cc: Michael Buesch <mb@bu3sch.de> Cc: Pavel Machek <pavel@ucw.cz> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Len Brown <lenb@kernel.org> Cc: Greg KH <greg@kroah.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/hw_random.h')
-rw-r--r--include/linux/hw_random.h10
1 files changed, 9 insertions, 1 deletions
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 {
44/** Register a new Hardware Random Number Generator driver. */ 44/** Register a new Hardware Random Number Generator driver. */
45extern int hwrng_register(struct hwrng *rng); 45extern int hwrng_register(struct hwrng *rng);
46/** Unregister a Hardware Random Number Generator driver. */ 46/** Unregister a Hardware Random Number Generator driver. */
47extern void hwrng_unregister(struct hwrng *rng); 47extern void __hwrng_unregister(struct hwrng *rng, bool suspended);
48static inline void hwrng_unregister(struct hwrng *rng)
49{
50 __hwrng_unregister(rng, false);
51}
52static inline void hwrng_unregister_suspended(struct hwrng *rng)
53{
54 __hwrng_unregister(rng, true);
55}
48 56
49#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
50#endif /* LINUX_HWRANDOM_H_ */ 58#endif /* LINUX_HWRANDOM_H_ */