git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge to kernel-2.6.20-1.2949.fc6.vs2.2.0.1
[linux-2.6.git]
/
arch
/
um
/
drivers
/
random.c
diff --git
a/arch/um/drivers/random.c
b/arch/um/drivers/random.c
index
f9e2219
..
73b2bdd
100644
(file)
--- a/
arch/um/drivers/random.c
+++ b/
arch/um/drivers/random.c
@@
-20,6
+20,10
@@
#define RNG_MISCDEV_MINOR 183 /* official */
#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)
static int random_fd = -1;
static int rng_dev_open (struct inode *inode, struct file *filp)
@@
-58,10
+62,8
@@
static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
if (filp->f_flags & O_NONBLOCK)
return ret ? : -EAGAIN;
if (filp->f_flags & O_NONBLOCK)
return ret ? : -EAGAIN;
- if(need_resched()){
- current->state = TASK_INTERRUPTIBLE;
- schedule_timeout(1);
- }
+ if(need_resched())
+ schedule_timeout_interruptible(1);
}
else return n;
if (signal_pending (current))
}
else return n;
if (signal_pending (current))
@@
-70,7
+72,7
@@
static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
return ret;
}
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,
.owner = THIS_MODULE,
.open = rng_dev_open,
.read = rng_dev_read,