summaryrefslogtreecommitdiff
blob: 841c32e0515ad7578a9f21c8927b4d16fc24221d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Source: https://github.com/s-moch/linux-saa716x/commit/1002d79c4ba60de0dbeacba0f289119556d7450d.patch

From 1002d79c4ba60de0dbeacba0f289119556d7450d Mon Sep 17 00:00:00 2001
From: Soeren Moch <smoch@web.de>
Date: Sat, 2 Dec 2017 21:23:34 +0100
Subject: [PATCH] saa716x_ff: Convert to new timer API

Convert to new timer API in linux-4.15.

Signed-off-by: Soeren Moch <smoch@web.de>
---
 drivers/media/common/saa716x/saa716x_ff_ir.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/common/saa716x/saa716x_ff_ir.c b/drivers/media/common/saa716x/saa716x_ff_ir.c
index ad6f38611026c..7894adff4d4f6 100644
--- a/linux/drivers/media/common/saa716x/saa716x_ff_ir.c
+++ b/linux/drivers/media/common/saa716x/saa716x_ff_ir.c
@@ -48,9 +48,9 @@ struct infrared {
 
 
 /* key-up timer */
-static void ir_emit_keyup(unsigned long parm)
+static void ir_emit_keyup(struct timer_list *t)
 {
-	struct infrared *ir = (struct infrared *) parm;
+	struct infrared *ir = from_timer(ir, t, keyup_timer);
 
 	if (!ir || !ir->key_pressed)
 		return;
@@ -184,9 +184,7 @@ int saa716x_ir_init(struct saa716x_dev *saa716x)
 	if (!ir)
 		return -ENOMEM;
 
-	init_timer(&ir->keyup_timer);
-	ir->keyup_timer.function = ir_emit_keyup;
-	ir->keyup_timer.data = (unsigned long) ir;
+	timer_setup(&ir->keyup_timer, ir_emit_keyup, 0);
 
 	input_dev = input_allocate_device();
 	if (!input_dev)