forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/ttpci/budget-ci.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * budget-ci.c: driver for the SAA7146 based Budget DVB cards
34 *
....@@ -7,21 +8,6 @@
78 * partially based on the Siemens DVB driver by Ralph+Marcus Metzler
89 *
910 * CI interface support (c) 2004 Andrew de Quincey <adq_dvb@lidskialf.net>
10
- *
11
- * This program is free software; you can redistribute it and/or
12
- * modify it under the terms of the GNU General Public License
13
- * as published by the Free Software Foundation; either version 2
14
- * of the License, or (at your option) any later version.
15
- *
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
21
- *
22
- * To obtain the license, point your browser to
23
- * http://www.gnu.org/copyleft/gpl.html
24
- *
2511 *
2612 * the project's page is at https://linuxtv.org
2713 */
....@@ -113,9 +99,10 @@
11399 u8 tuner_pll_address; /* used for philips_tdm1316l configs */
114100 };
115101
116
-static void msp430_ir_interrupt(unsigned long data)
102
+static void msp430_ir_interrupt(struct tasklet_struct *t)
117103 {
118
- struct budget_ci *budget_ci = (struct budget_ci *) data;
104
+ struct budget_ci_ir *ir = from_tasklet(ir, t, msp430_irq_tasklet);
105
+ struct budget_ci *budget_ci = container_of(ir, typeof(*budget_ci), ir);
119106 struct rc_dev *dev = budget_ci->ir.dev;
120107 u32 command = ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8;
121108
....@@ -243,8 +230,7 @@
243230
244231 budget_ci->ir.dev = dev;
245232
246
- tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt,
247
- (unsigned long) budget_ci);
233
+ tasklet_setup(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt);
248234
249235 SAA7146_IER_ENABLE(saa, MASK_06);
250236 saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI);
....@@ -362,9 +348,10 @@
362348 return 0;
363349 }
364350
365
-static void ciintf_interrupt(unsigned long data)
351
+static void ciintf_interrupt(struct tasklet_struct *t)
366352 {
367
- struct budget_ci *budget_ci = (struct budget_ci *) data;
353
+ struct budget_ci *budget_ci = from_tasklet(budget_ci, t,
354
+ ciintf_irq_tasklet);
368355 struct saa7146_dev *saa = budget_ci->budget.dev;
369356 unsigned int flags;
370357
....@@ -505,7 +492,7 @@
505492
506493 // Setup CI slot IRQ
507494 if (budget_ci->ci_irq) {
508
- tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci);
495
+ tasklet_setup(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt);
509496 if (budget_ci->slot_status != SLOTSTATUS_NONE) {
510497 saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO);
511498 } else {