forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/media/pci/saa7164/saa7164-vbi.c
....@@ -1,18 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for the NXP SAA7164 PCIe bridge
34 *
45 * Copyright (c) 2010-2015 Steven Toth <stoth@kernellabs.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- *
15
- * GNU General Public License for more details.
166 */
177
188 #include "saa7164.h"
....@@ -208,20 +198,13 @@
208198 struct saa7164_port *port = fh->port;
209199 struct saa7164_dev *dev = port->dev;
210200
211
- strcpy(cap->driver, dev->name);
212
- strlcpy(cap->card, saa7164_boards[dev->board].name,
201
+ strscpy(cap->driver, dev->name, sizeof(cap->driver));
202
+ strscpy(cap->card, saa7164_boards[dev->board].name,
213203 sizeof(cap->card));
214204 sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci));
215
-
216
- cap->device_caps =
217
- V4L2_CAP_VBI_CAPTURE |
218
- V4L2_CAP_READWRITE |
219
- V4L2_CAP_TUNER;
220
-
221
- cap->capabilities = cap->device_caps |
222
- V4L2_CAP_VIDEO_CAPTURE |
223
- V4L2_CAP_DEVICE_CAPS;
224
-
205
+ cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
206
+ V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE |
207
+ V4L2_CAP_DEVICE_CAPS;
225208 return 0;
226209 }
227210
....@@ -685,6 +668,8 @@
685668 .ioctl_ops = &vbi_ioctl_ops,
686669 .minor = -1,
687670 .tvnorms = SAA7164_NORMS,
671
+ .device_caps = V4L2_CAP_VBI_CAPTURE | V4L2_CAP_READWRITE |
672
+ V4L2_CAP_TUNER,
688673 };
689674
690675 static struct video_device *saa7164_vbi_alloc(
....@@ -718,8 +703,7 @@
718703
719704 dprintk(DBGLVL_VBI, "%s()\n", __func__);
720705
721
- if (port->type != SAA7164_MPEG_VBI)
722
- BUG();
706
+ BUG_ON(port->type != SAA7164_MPEG_VBI);
723707
724708 /* Sanity check that the PCI configuration space is active */
725709 if (port->hwcfg.BARLocation == 0) {
....@@ -771,8 +755,7 @@
771755
772756 dprintk(DBGLVL_VBI, "%s(port=%d)\n", __func__, port->nr);
773757
774
- if (port->type != SAA7164_MPEG_VBI)
775
- BUG();
758
+ BUG_ON(port->type != SAA7164_MPEG_VBI);
776759
777760 if (port->v4l_device) {
778761 if (port->v4l_device->minor != -1)