X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fchar%2Fnwbutton.c;h=2604246501e499eda6568527e4c64d8b5a13bc48;hb=53f8c573ea3b54b7e1b81d2cd403373b08103736;hp=ea1aa7764f8e1a0b756b8be75172488bdc7bf714;hpb=3e04767a4647ea6c61ed05abe803c052ce123960;p=~andy%2Flinux diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c index ea1aa7764f8..2604246501e 100644 --- a/drivers/char/nwbutton.c +++ b/drivers/char/nwbutton.c @@ -23,8 +23,11 @@ #define __NWBUTTON_C /* Tell the header file who we are */ #include "nwbutton.h" +static void button_sequence_finished (unsigned long parameters); + static int button_press_count; /* The count of button presses */ -static struct timer_list button_timer; /* Times for the end of a sequence */ +/* Times for the end of a sequence */ +static DEFINE_TIMER(button_timer, button_sequence_finished, 0, 0); static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */ static char button_output_buffer[32]; /* Stores data to write out of device */ static int bcount; /* The number of bytes in the buffer */ @@ -144,16 +147,10 @@ static void button_sequence_finished (unsigned long parameters) * increments the counter. */ -static irqreturn_t button_handler (int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t button_handler (int irq, void *dev_id) { - if (button_press_count) { - del_timer (&button_timer); - } button_press_count++; - init_timer (&button_timer); - button_timer.function = button_sequence_finished; - button_timer.expires = (jiffies + bdelay); - add_timer (&button_timer); + mod_timer(&button_timer, jiffies + bdelay); return IRQ_HANDLED; }