git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'topic/azt3328' into for-linus
[pandora-kernel.git]
/
drivers
/
char
/
nwbutton.c
diff --git
a/drivers/char/nwbutton.c
b/drivers/char/nwbutton.c
index
4083b78
..
2604246
100644
(file)
--- a/
drivers/char/nwbutton.c
+++ b/
drivers/char/nwbutton.c
@@
-4,7
+4,6
@@
*
*/
*
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
@@
-24,8
+23,11
@@
#define __NWBUTTON_C /* Tell the header file who we are */
#include "nwbutton.h"
#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 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 */
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 */
@@
-128,9
+130,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 */
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);
#endif /* CONFIG_NWBUTTON_REBOOT */
button_consume_callbacks (button_press_count);
bcount = sprintf (button_output_buffer, "%d\n", button_press_count);
@@
-146,16
+147,10
@@
static void button_sequence_finished (unsigned long parameters)
* increments the counter.
*/
* 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++;
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;
}
return IRQ_HANDLED;
}
@@
-184,7
+179,7
@@
static int button_read (struct file *filp, char __user *buffer,
* attempts to perform these operations on the device.
*/
* 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,
};
.owner = THIS_MODULE,
.read = button_read,
};
@@
-224,7
+219,7
@@
static int __init nwbutton_init(void)
return -EBUSY;
}
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);
"nwbutton", NULL)) {
printk (KERN_WARNING "nwbutton: IRQ %d is not free.\n",
IRQ_NETWINDER_BUTTON);