forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/ttpci/av7110_v4l.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * av7110_v4l.c: av7110 video4linux interface for DVB and Siemens DVB-C analog module
34 *
....@@ -6,18 +7,6 @@
67 *
78 * originally based on code by:
89 * Copyright (C) 1998,1999 Christian Theiss <mistert@rz.fh-augsburg.de>
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public License
12
- * as published by the Free Software Foundation; either version 2
13
- * of the License, or (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- * To obtain the license, point your browser to
20
- * http://www.gnu.org/copyleft/gpl.html
2110 *
2211 * the project's page is at https://linuxtv.org
2312 */
....@@ -171,9 +160,9 @@
171160 buf[1] = div & 0xff;
172161 buf[2] = 0x8e;
173162
174
- if (freq < (u32) (16 * 168.25))
163
+ if (freq < 16U * 16825 / 100)
175164 config = 0xa0;
176
- else if (freq < (u32) (16 * 447.25))
165
+ else if (freq < 16U * 44725 / 100)
177166 config = 0x90;
178167 else
179168 config = 0x30;
....@@ -332,7 +321,7 @@
332321 return -EINVAL;
333322
334323 memset(t, 0, sizeof(*t));
335
- strcpy((char *)t->name, "Television");
324
+ strscpy((char *)t->name, "Television", sizeof(t->name));
336325
337326 t->type = V4L2_TUNER_ANALOG_TV;
338327 t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO |
....@@ -842,7 +831,7 @@
842831 if (FW_VERSION(av7110->arm_app) < 0x2623)
843832 vv_data->capabilities &= ~V4L2_CAP_SLICED_VBI_OUTPUT;
844833
845
- if (saa7146_register_device(&av7110->v4l_dev, dev, "av7110", VFL_TYPE_GRABBER)) {
834
+ if (saa7146_register_device(&av7110->v4l_dev, dev, "av7110", VFL_TYPE_VIDEO)) {
846835 ERR("cannot register capture device. skipping\n");
847836 saa7146_vv_release(dev);
848837 return -ENODEV;