summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2009-01-03 00:06:34 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-03 12:01:23 -0800
commit2f983570010a0dcb26d988da02d7ccfad00c807c (patch)
tree39fd89fd04d940306c02425927fc1308b26357b0 /drivers/char
parente9e67a8b579d9605a3d06f7430dbb40465c97bf1 (diff)
downloadkernel-crypto-2f983570010a0dcb26d988da02d7ccfad00c807c.tar.gz
kernel-crypto-2f983570010a0dcb26d988da02d7ccfad00c807c.tar.xz
kernel-crypto-2f983570010a0dcb26d988da02d7ccfad00c807c.zip
sparseirq: move set/get_timer_rand_state back to .c
those two functions only used in that C file Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/random.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index d26891bfcd4..c7afc068c28 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -559,7 +559,40 @@ struct timer_rand_state {
};
#ifndef CONFIG_SPARSE_IRQ
-struct timer_rand_state *irq_timer_state[NR_IRQS];
+
+static struct timer_rand_state *irq_timer_state[NR_IRQS];
+
+static struct timer_rand_state *get_timer_rand_state(unsigned int irq)
+{
+ return irq_timer_state[irq];
+}
+
+static void set_timer_rand_state(unsigned int irq,
+ struct timer_rand_state *state)
+{
+ irq_timer_state[irq] = state;
+}
+
+#else
+
+static struct timer_rand_state *get_timer_rand_state(unsigned int irq)
+{
+ struct irq_desc *desc;
+
+ desc = irq_to_desc(irq);
+
+ return desc->timer_rand_state;
+}
+
+static void set_timer_rand_state(unsigned int irq,
+ struct timer_rand_state *state)
+{
+ struct irq_desc *desc;
+
+ desc = irq_to_desc(irq);
+
+ desc->timer_rand_state = state;
+}
#endif
static struct timer_rand_state input_timer_state;
@@ -919,11 +952,6 @@ void rand_initialize_irq(int irq)
{
struct timer_rand_state *state;
-#ifndef CONFIG_SPARSE_IRQ
- if (irq >= nr_irqs)
- return;
-#endif
-
state = get_timer_rand_state(irq);
if (state)