aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/nwbutton.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/nwbutton.c')
-rw-r--r--drivers/char/nwbutton.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c
index 2d264971d839..2604246501e4 100644
--- a/drivers/char/nwbutton.c
+++ b/drivers/char/nwbutton.c
@@ -23,8 +23,11 @@
23#define __NWBUTTON_C /* Tell the header file who we are */ 23#define __NWBUTTON_C /* Tell the header file who we are */
24#include "nwbutton.h" 24#include "nwbutton.h"
25 25
26static void button_sequence_finished (unsigned long parameters);
27
26static int button_press_count; /* The count of button presses */ 28static int button_press_count; /* The count of button presses */
27static struct timer_list button_timer; /* Times for the end of a sequence */ 29/* Times for the end of a sequence */
30static DEFINE_TIMER(button_timer, button_sequence_finished, 0, 0);
28static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */ 31static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */
29static char button_output_buffer[32]; /* Stores data to write out of device */ 32static char button_output_buffer[32]; /* Stores data to write out of device */
30static int bcount; /* The number of bytes in the buffer */ 33static int bcount; /* The number of bytes in the buffer */
@@ -146,14 +149,8 @@ static void button_sequence_finished (unsigned long parameters)
146 149
147static irqreturn_t button_handler (int irq, void *dev_id) 150static irqreturn_t button_handler (int irq, void *dev_id)
148{ 151{
149 if (button_press_count) {
150 del_timer (&button_timer);
151 }
152 button_press_count++; 152 button_press_count++;
153 init_timer (&button_timer); 153 mod_timer(&button_timer, jiffies + bdelay);
154 button_timer.function = button_sequence_finished;
155 button_timer.expires = (jiffies + bdelay);
156 add_timer (&button_timer);
157 154
158 return IRQ_HANDLED; 155 return IRQ_HANDLED;
159} 156}