| .. | .. |
|---|
| 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" |
|---|
| .. | .. |
|---|
| 258 | 248 | if (i->index >= 7) |
|---|
| 259 | 249 | return -EINVAL; |
|---|
| 260 | 250 | |
|---|
| 261 | | - strcpy(i->name, inputs[i->index]); |
|---|
| 251 | + strscpy(i->name, inputs[i->index], sizeof(i->name)); |
|---|
| 262 | 252 | |
|---|
| 263 | 253 | if (i->index == 0) |
|---|
| 264 | 254 | i->type = V4L2_INPUT_TYPE_TUNER; |
|---|
| .. | .. |
|---|
| 325 | 315 | if (0 != t->index) |
|---|
| 326 | 316 | return -EINVAL; |
|---|
| 327 | 317 | |
|---|
| 328 | | - strcpy(t->name, "tuner"); |
|---|
| 318 | + strscpy(t->name, "tuner", sizeof(t->name)); |
|---|
| 329 | 319 | t->capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO; |
|---|
| 330 | 320 | t->rangelow = SAA7164_TV_MIN_FREQ; |
|---|
| 331 | 321 | t->rangehigh = SAA7164_TV_MAX_FREQ; |
|---|
| .. | .. |
|---|
| 497 | 487 | struct saa7164_port *port = fh->port; |
|---|
| 498 | 488 | struct saa7164_dev *dev = port->dev; |
|---|
| 499 | 489 | |
|---|
| 500 | | - strcpy(cap->driver, dev->name); |
|---|
| 501 | | - strlcpy(cap->card, saa7164_boards[dev->board].name, |
|---|
| 490 | + strscpy(cap->driver, dev->name, sizeof(cap->driver)); |
|---|
| 491 | + strscpy(cap->card, saa7164_boards[dev->board].name, |
|---|
| 502 | 492 | sizeof(cap->card)); |
|---|
| 503 | 493 | sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); |
|---|
| 504 | | - |
|---|
| 505 | | - cap->device_caps = |
|---|
| 506 | | - V4L2_CAP_VIDEO_CAPTURE | |
|---|
| 507 | | - V4L2_CAP_READWRITE | |
|---|
| 508 | | - V4L2_CAP_TUNER; |
|---|
| 509 | | - |
|---|
| 510 | | - cap->capabilities = cap->device_caps | |
|---|
| 511 | | - V4L2_CAP_VBI_CAPTURE | |
|---|
| 512 | | - V4L2_CAP_DEVICE_CAPS; |
|---|
| 513 | | - |
|---|
| 494 | + cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | |
|---|
| 495 | + V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE | |
|---|
| 496 | + V4L2_CAP_DEVICE_CAPS; |
|---|
| 514 | 497 | return 0; |
|---|
| 515 | 498 | } |
|---|
| 516 | 499 | |
|---|
| .. | .. |
|---|
| 520 | 503 | if (f->index != 0) |
|---|
| 521 | 504 | return -EINVAL; |
|---|
| 522 | 505 | |
|---|
| 523 | | - strlcpy(f->description, "MPEG", sizeof(f->description)); |
|---|
| 524 | 506 | f->pixelformat = V4L2_PIX_FMT_MPEG; |
|---|
| 525 | 507 | |
|---|
| 526 | 508 | return 0; |
|---|
| .. | .. |
|---|
| 983 | 965 | .ioctl_ops = &mpeg_ioctl_ops, |
|---|
| 984 | 966 | .minor = -1, |
|---|
| 985 | 967 | .tvnorms = SAA7164_NORMS, |
|---|
| 968 | + .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | |
|---|
| 969 | + V4L2_CAP_TUNER, |
|---|
| 986 | 970 | }; |
|---|
| 987 | 971 | |
|---|
| 988 | 972 | static struct video_device *saa7164_encoder_alloc( |
|---|
| .. | .. |
|---|
| 1103 | 1087 | v4l2_ctrl_handler_setup(hdl); |
|---|
| 1104 | 1088 | video_set_drvdata(port->v4l_device, port); |
|---|
| 1105 | 1089 | result = video_register_device(port->v4l_device, |
|---|
| 1106 | | - VFL_TYPE_GRABBER, -1); |
|---|
| 1090 | + VFL_TYPE_VIDEO, -1); |
|---|
| 1107 | 1091 | if (result < 0) { |
|---|
| 1108 | 1092 | printk(KERN_INFO "%s: can't register mpeg device\n", |
|---|
| 1109 | 1093 | dev->name); |
|---|