diff options
Diffstat (limited to 'drivers/char/nwbutton.c')
-rw-r--r-- | drivers/char/nwbutton.c | 13 |
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 | ||
26 | static void button_sequence_finished (unsigned long parameters); | ||
27 | |||
26 | static int button_press_count; /* The count of button presses */ | 28 | static int button_press_count; /* The count of button presses */ |
27 | static struct timer_list button_timer; /* Times for the end of a sequence */ | 29 | /* Times for the end of a sequence */ |
30 | static DEFINE_TIMER(button_timer, button_sequence_finished, 0, 0); | ||
28 | static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */ | 31 | static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */ |
29 | static char button_output_buffer[32]; /* Stores data to write out of device */ | 32 | static char button_output_buffer[32]; /* Stores data to write out of device */ |
30 | static int bcount; /* The number of bytes in the buffer */ | 33 | static int bcount; /* The number of bytes in the buffer */ |
@@ -146,14 +149,8 @@ static void button_sequence_finished (unsigned long parameters) | |||
146 | 149 | ||
147 | static irqreturn_t button_handler (int irq, void *dev_id) | 150 | static 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 | } |