]>
Commit | Line | Data |
---|---|---|
5ab4a76b SL |
1 | From fa200bc13427b8ad8da5349d2d11976132d560f8 Mon Sep 17 00:00:00 2001 |
2 | From: Sasha Levin <sashal@kernel.org> | |
3 | Date: Tue, 13 Feb 2024 10:54:47 +0100 | |
4 | Subject: media: sta2x11: fix irq handler cast | |
5 | ||
6 | From: Arnd Bergmann <arnd@arndb.de> | |
7 | ||
8 | [ Upstream commit 3de49ae81c3a0f83a554ecbce4c08e019f30168e ] | |
9 | ||
10 | clang-16 warns about casting incompatible function pointers: | |
11 | ||
12 | drivers/media/pci/sta2x11/sta2x11_vip.c:1057:6: error: cast from 'irqreturn_t (*)(int, struct sta2x11_vip *)' (aka 'enum irqreturn (*)(int, struct sta2x11_vip *)') to 'irq_handler_t' (aka 'enum irqreturn (*)(int, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict] | |
13 | ||
14 | Change the prototype of the irq handler to the regular version with a | |
15 | local variable to adjust the argument type. | |
16 | ||
17 | Signed-off-by: Arnd Bergmann <arnd@arndb.de> | |
18 | Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> | |
19 | [hverkuil: update argument documentation] | |
20 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
21 | --- | |
22 | drivers/media/pci/sta2x11/sta2x11_vip.c | 9 ++++----- | |
23 | 1 file changed, 4 insertions(+), 5 deletions(-) | |
24 | ||
25 | diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c | |
26 | index 524912f20d9f2..74bbdc11abbb3 100644 | |
27 | --- a/drivers/media/pci/sta2x11/sta2x11_vip.c | |
28 | +++ b/drivers/media/pci/sta2x11/sta2x11_vip.c | |
29 | @@ -760,7 +760,7 @@ static const struct video_device video_dev_template = { | |
30 | /** | |
31 | * vip_irq - interrupt routine | |
32 | * @irq: Number of interrupt ( not used, correct number is assumed ) | |
33 | - * @vip: local data structure containing all information | |
34 | + * @data: local data structure containing all information | |
35 | * | |
36 | * check for both frame interrupts set ( top and bottom ). | |
37 | * check FIFO overflow, but limit number of log messages after open. | |
38 | @@ -770,8 +770,9 @@ static const struct video_device video_dev_template = { | |
39 | * | |
40 | * IRQ_HANDLED, interrupt done. | |
41 | */ | |
42 | -static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip) | |
43 | +static irqreturn_t vip_irq(int irq, void *data) | |
44 | { | |
45 | + struct sta2x11_vip *vip = data; | |
46 | unsigned int status; | |
47 | ||
48 | status = reg_read(vip, DVP_ITS); | |
49 | @@ -1053,9 +1054,7 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev, | |
50 | ||
51 | spin_lock_init(&vip->slock); | |
52 | ||
53 | - ret = request_irq(pdev->irq, | |
54 | - (irq_handler_t) vip_irq, | |
55 | - IRQF_SHARED, KBUILD_MODNAME, vip); | |
56 | + ret = request_irq(pdev->irq, vip_irq, IRQF_SHARED, KBUILD_MODNAME, vip); | |
57 | if (ret) { | |
58 | dev_err(&pdev->dev, "request_irq failed\n"); | |
59 | ret = -ENODEV; | |
60 | -- | |
61 | 2.43.0 | |
62 |