X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fum%2Fdrivers%2Frandom.c;h=e942e836f9954335651fc3c2b6587c2bd7d7e888;hb=87a72f9e171e558a0288aa83ef1dc6ae4af32224;hp=ba471f5864a6d7d6815f3847a36aa78b4ed1a5e3;hpb=a892acacd3a8546ac161526522f13b5174f2c471;p=linux-2.6 diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c index ba471f5864..e942e836f9 100644 --- a/arch/um/drivers/random.c +++ b/arch/um/drivers/random.c @@ -20,6 +20,10 @@ #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) @@ -68,12 +72,13 @@ static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size, return ret; } -static struct file_operations rng_chrdev_ops = { +static const struct file_operations rng_chrdev_ops = { .owner = THIS_MODULE, .open = rng_dev_open, .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,