X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fnwbutton.c;h=2d264971d839809d70ba8fe780ed3ba6ef89ff33;hb=refs%2Fheads%2Fvserver;hp=513777e538f61a10e0b361ea7edf089b6ad1607f;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/char/nwbutton.c b/drivers/char/nwbutton.c index 513777e53..2d264971d 100644 --- a/drivers/char/nwbutton.c +++ b/drivers/char/nwbutton.c @@ -4,7 +4,6 @@ * */ -#include #include #include #include @@ -128,9 +127,8 @@ static void button_consume_callbacks (int bpcount) static void button_sequence_finished (unsigned long parameters) { #ifdef CONFIG_NWBUTTON_REBOOT /* Reboot using button is enabled */ - if (button_press_count == reboot_count) { - kill_proc (1, SIGINT, 1); /* Ask init to reboot us */ - } + if (button_press_count == reboot_count) + kill_cad_pid(SIGINT, 1); /* Ask init to reboot us */ #endif /* CONFIG_NWBUTTON_REBOOT */ button_consume_callbacks (button_press_count); bcount = sprintf (button_output_buffer, "%d\n", button_press_count); @@ -146,7 +144,7 @@ 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); @@ -170,7 +168,7 @@ static irqreturn_t button_handler (int irq, void *dev_id, struct pt_regs *regs) * device at any one time. */ -static int button_read (struct file *filp, char *buffer, +static int button_read (struct file *filp, char __user *buffer, size_t count, loff_t *ppos) { interruptible_sleep_on (&button_wait_queue); @@ -184,7 +182,7 @@ static int button_read (struct file *filp, char *buffer, * attempts to perform these operations on the device. */ -static struct file_operations button_fops = { +static const struct file_operations button_fops = { .owner = THIS_MODULE, .read = button_read, }; @@ -224,7 +222,7 @@ static int __init nwbutton_init(void) return -EBUSY; } - if (request_irq (IRQ_NETWINDER_BUTTON, button_handler, SA_INTERRUPT, + if (request_irq (IRQ_NETWINDER_BUTTON, button_handler, IRQF_DISABLED, "nwbutton", NULL)) { printk (KERN_WARNING "nwbutton: IRQ %d is not free.\n", IRQ_NETWINDER_BUTTON);