]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/random.c
[PATCH] i2Output always takes kernel data now
[linux-2.6-omap-h63xx.git] / drivers / char / random.c
index 58f3512c52e16f1b92de5307c9e482a1ccf5b91f..07f47a0208a7200b4e0ba1f32bd747d82ae1db6b 100644 (file)
  */
 
 #include <linux/utsname.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
@@ -417,7 +416,7 @@ static struct entropy_store input_pool = {
        .poolinfo = &poolinfo_table[0],
        .name = "input",
        .limit = 1,
-       .lock = SPIN_LOCK_UNLOCKED,
+       .lock = __SPIN_LOCK_UNLOCKED(&input_pool.lock),
        .pool = input_pool_data
 };
 
@@ -426,7 +425,7 @@ static struct entropy_store blocking_pool = {
        .name = "blocking",
        .limit = 1,
        .pull = &input_pool,
-       .lock = SPIN_LOCK_UNLOCKED,
+       .lock = __SPIN_LOCK_UNLOCKED(&blocking_pool.lock),
        .pool = blocking_pool_data
 };
 
@@ -434,7 +433,7 @@ static struct entropy_store nonblocking_pool = {
        .poolinfo = &poolinfo_table[1],
        .name = "nonblocking",
        .pull = &input_pool,
-       .lock = SPIN_LOCK_UNLOCKED,
+       .lock = __SPIN_LOCK_UNLOCKED(&nonblocking_pool.lock),
        .pool = nonblocking_pool_data
 };
 
@@ -656,6 +655,7 @@ void add_interrupt_randomness(int irq)
        add_timer_randomness(irq_timer_state[irq], 0x100 + irq);
 }
 
+#ifdef CONFIG_BLOCK
 void add_disk_randomness(struct gendisk *disk)
 {
        if (!disk || !disk->random)
@@ -668,6 +668,7 @@ void add_disk_randomness(struct gendisk *disk)
 }
 
 EXPORT_SYMBOL(add_disk_randomness);
+#endif
 
 #define EXTRACT_SIZE 10
 
@@ -888,8 +889,8 @@ static void init_std_data(struct entropy_store *r)
 
        do_gettimeofday(&tv);
        add_entropy_words(r, (__u32 *)&tv, sizeof(tv)/4);
-       add_entropy_words(r, (__u32 *)&system_utsname,
-                         sizeof(system_utsname)/4);
+       add_entropy_words(r, (__u32 *)utsname(),
+                         sizeof(*(utsname()))/4);
 }
 
 static int __init rand_initialize(void)
@@ -919,6 +920,7 @@ void rand_initialize_irq(int irq)
        }
 }
 
+#ifdef CONFIG_BLOCK
 void rand_initialize_disk(struct gendisk *disk)
 {
        struct timer_rand_state *state;
@@ -933,6 +935,7 @@ void rand_initialize_disk(struct gendisk *disk)
                disk->random = state;
        }
 }
+#endif
 
 static ssize_t
 random_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos)