| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Driver for the NXP SAA7164 PCIe bridge |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 16 | 6 | */ |
|---|
| 17 | 7 | |
|---|
| 18 | 8 | #include "saa7164.h" |
|---|
| .. | .. |
|---|
| 208 | 198 | struct saa7164_port *port = fh->port; |
|---|
| 209 | 199 | struct saa7164_dev *dev = port->dev; |
|---|
| 210 | 200 | |
|---|
| 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, |
|---|
| 213 | 203 | sizeof(cap->card)); |
|---|
| 214 | 204 | 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; |
|---|
| 225 | 208 | return 0; |
|---|
| 226 | 209 | } |
|---|
| 227 | 210 | |
|---|
| .. | .. |
|---|
| 685 | 668 | .ioctl_ops = &vbi_ioctl_ops, |
|---|
| 686 | 669 | .minor = -1, |
|---|
| 687 | 670 | .tvnorms = SAA7164_NORMS, |
|---|
| 671 | + .device_caps = V4L2_CAP_VBI_CAPTURE | V4L2_CAP_READWRITE | |
|---|
| 672 | + V4L2_CAP_TUNER, |
|---|
| 688 | 673 | }; |
|---|
| 689 | 674 | |
|---|
| 690 | 675 | static struct video_device *saa7164_vbi_alloc( |
|---|
| .. | .. |
|---|
| 718 | 703 | |
|---|
| 719 | 704 | dprintk(DBGLVL_VBI, "%s()\n", __func__); |
|---|
| 720 | 705 | |
|---|
| 721 | | - if (port->type != SAA7164_MPEG_VBI) |
|---|
| 722 | | - BUG(); |
|---|
| 706 | + BUG_ON(port->type != SAA7164_MPEG_VBI); |
|---|
| 723 | 707 | |
|---|
| 724 | 708 | /* Sanity check that the PCI configuration space is active */ |
|---|
| 725 | 709 | if (port->hwcfg.BARLocation == 0) { |
|---|
| .. | .. |
|---|
| 771 | 755 | |
|---|
| 772 | 756 | dprintk(DBGLVL_VBI, "%s(port=%d)\n", __func__, port->nr); |
|---|
| 773 | 757 | |
|---|
| 774 | | - if (port->type != SAA7164_MPEG_VBI) |
|---|
| 775 | | - BUG(); |
|---|
| 758 | + BUG_ON(port->type != SAA7164_MPEG_VBI); |
|---|
| 776 | 759 | |
|---|
| 777 | 760 | if (port->v4l_device) { |
|---|
| 778 | 761 | if (port->v4l_device->minor != -1) |
|---|