forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/ttpci/budget-core.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * budget-core.c: driver for the SAA7146 based Budget DVB cards
34 *
....@@ -12,21 +13,6 @@
1213 * Michael Dreher <michael@5dot1.de>,
1314 * Oliver Endriss <o.endriss@gmx.de>,
1415 * Andreas 'randy' Weinberger
15
- *
16
- * This program is free software; you can redistribute it and/or
17
- * modify it under the terms of the GNU General Public License
18
- * as published by the Free Software Foundation; either version 2
19
- * of the License, or (at your option) any later version.
20
- *
21
- *
22
- * This program is distributed in the hope that it will be useful,
23
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
- * GNU General Public License for more details.
26
- *
27
- * To obtain the license, point your browser to
28
- * http://www.gnu.org/copyleft/gpl.html
29
- *
3016 *
3117 * the project's page is at https://linuxtv.org
3218 */
....@@ -185,9 +171,9 @@
185171 return ret;
186172 }
187173
188
-static void vpeirq(unsigned long data)
174
+static void vpeirq(struct tasklet_struct *t)
189175 {
190
- struct budget *budget = (struct budget *) data;
176
+ struct budget *budget = from_tasklet(budget, t, vpe_tasklet);
191177 u8 *mem = (u8 *) (budget->grabbing);
192178 u32 olddma = budget->ttbp;
193179 u32 newdma = saa7146_read(budget->dev, PCI_VDP3);
....@@ -509,10 +495,12 @@
509495 if (bi->type != BUDGET_FS_ACTIVY)
510496 saa7146_write(dev, GPIO_CTRL, 0x500000); /* GPIO 3 = 1 */
511497
512
- strlcpy(budget->i2c_adap.name, budget->card->name, sizeof(budget->i2c_adap.name));
498
+ strscpy(budget->i2c_adap.name, budget->card->name,
499
+ sizeof(budget->i2c_adap.name));
513500
514501 saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120);
515
- strcpy(budget->i2c_adap.name, budget->card->name);
502
+ strscpy(budget->i2c_adap.name, budget->card->name,
503
+ sizeof(budget->i2c_adap.name));
516504
517505 if (i2c_add_adapter(&budget->i2c_adap) < 0) {
518506 ret = -ENOMEM;
....@@ -531,7 +519,7 @@
531519 /* upload all */
532520 saa7146_write(dev, GPIO_CTRL, 0x000000);
533521
534
- tasklet_init(&budget->vpe_tasklet, vpeirq, (unsigned long) budget);
522
+ tasklet_setup(&budget->vpe_tasklet, vpeirq);
535523
536524 /* frontend power on */
537525 if (bi->type != BUDGET_FS_ACTIVY)