Merge branch 'for-2.6.25' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerp...
[sfrench/cifs-2.6.git] / arch / um / drivers / random.c
index ae9909415b9cdb372c1f1f0c1602a21a4c2e86b3..71f0959c15357b4587cd10c816d3eca1db1fbe92 100644 (file)
@@ -5,6 +5,7 @@
  * This software may be used and distributed according to the terms
  * of the GNU General Public License, incorporated herein by reference.
  */
+#include <linux/sched.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 
 #define RNG_MISCDEV_MINOR              183 /* official */
 
+/* Changed at init time, in the non-modular case, and at module load
+ * time, in the module case.  Presumably, the module subsystem
+ * protects against a module being loaded twice at the same time.
+ */
 static int random_fd = -1;
 
 static int rng_dev_open (struct inode *inode, struct file *filp)
@@ -74,6 +79,7 @@ static const struct file_operations rng_chrdev_ops = {
        .read           = rng_dev_read,
 };
 
+/* rng_init shouldn't be called more than once at boot time */
 static struct miscdevice rng_miscdev = {
        RNG_MISCDEV_MINOR,
        RNG_MODULE_NAME,