| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2015 VanguardiaSur - www.vanguardiasur.com.ar |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Based on original driver by Krzysztof Ha?asa: |
|---|
| 5 | 6 | * Copyright (C) 2015 Industrial Research Institute for Automation |
|---|
| 6 | 7 | * and Measurements PIAP |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms of version 2 of the GNU General Public License |
|---|
| 10 | | - * as published by the Free Software Foundation. |
|---|
| 11 | | - * |
|---|
| 12 | 8 | */ |
|---|
| 13 | 9 | |
|---|
| 14 | 10 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 765 | 761 | struct tw686x_video_channel *vc = video_drvdata(file); |
|---|
| 766 | 762 | struct tw686x_dev *dev = vc->dev; |
|---|
| 767 | 763 | |
|---|
| 768 | | - strlcpy(cap->driver, "tw686x", sizeof(cap->driver)); |
|---|
| 769 | | - strlcpy(cap->card, dev->name, sizeof(cap->card)); |
|---|
| 764 | + strscpy(cap->driver, "tw686x", sizeof(cap->driver)); |
|---|
| 765 | + strscpy(cap->card, dev->name, sizeof(cap->card)); |
|---|
| 770 | 766 | snprintf(cap->bus_info, sizeof(cap->bus_info), |
|---|
| 771 | 767 | "PCI:%s", pci_name(dev->pci_dev)); |
|---|
| 772 | | - cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | |
|---|
| 773 | | - V4L2_CAP_READWRITE; |
|---|
| 774 | | - cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; |
|---|
| 775 | 768 | return 0; |
|---|
| 776 | 769 | } |
|---|
| 777 | 770 | |
|---|
| .. | .. |
|---|
| 1284 | 1277 | vdev->minor = -1; |
|---|
| 1285 | 1278 | vdev->lock = &vc->vb_mutex; |
|---|
| 1286 | 1279 | vdev->ctrl_handler = &vc->ctrl_handler; |
|---|
| 1280 | + vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | |
|---|
| 1281 | + V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; |
|---|
| 1287 | 1282 | vc->device = vdev; |
|---|
| 1288 | 1283 | video_set_drvdata(vdev, vc); |
|---|
| 1289 | 1284 | |
|---|
| 1290 | | - err = video_register_device(vdev, VFL_TYPE_GRABBER, -1); |
|---|
| 1291 | | - if (err < 0) |
|---|
| 1285 | + err = video_register_device(vdev, VFL_TYPE_VIDEO, -1); |
|---|
| 1286 | + if (err < 0) { |
|---|
| 1287 | + video_device_release(vdev); |
|---|
| 1292 | 1288 | goto error; |
|---|
| 1289 | + } |
|---|
| 1293 | 1290 | vc->num = vdev->num; |
|---|
| 1294 | 1291 | } |
|---|
| 1295 | 1292 | |
|---|