From 671282cef0894efe32eae6f070e6c3f518288f20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=83=AD=E6=AF=85?= Date: Mon, 4 Aug 2014 09:06:22 +0800 Subject: [PATCH] inv_mpu: only setup timer once. --- drivers/misc/inv_mpu/timerirq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/inv_mpu/timerirq.c b/drivers/misc/inv_mpu/timerirq.c index 5aeb7602c5cc..a26620f92c4b 100755 --- a/drivers/misc/inv_mpu/timerirq.c +++ b/drivers/misc/inv_mpu/timerirq.c @@ -102,7 +102,6 @@ static int start_timerirq(struct timerirq_data *data) data->data_ready = false; init_completion(&data->timer_done); - setup_timer(&data->timer, timerirq_handler, (unsigned long)data); return mod_timer(&data->timer, jiffies + msecs_to_jiffies(data->period)); @@ -138,6 +137,7 @@ static int timerirq_open(struct inode *inode, struct file *file) data->pid = current->pid; init_waitqueue_head(&data->timerirq_wait); + setup_timer(&data->timer, timerirq_handler, (unsigned long)data); dev_dbg(data->dev->this_device, "%s current->pid %d\n", __func__, current->pid); return 0; -- 2.34.1