| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Framework for ISA radio drivers. |
|---|
| 3 | 4 | * This takes care of all the V4L2 scaffolding, allowing the ISA drivers |
|---|
| 4 | 5 | * to concentrate on the actual hardware operation. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (C) 2012 Hans Verkuil <hans.verkuil@cisco.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or |
|---|
| 9 | | - * modify it under the terms of the GNU General Public License |
|---|
| 10 | | - * version 2 as published by the Free Software Foundation. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope that it will be useful, but |
|---|
| 13 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 15 | | - * General Public License for more details. |
|---|
| 16 | 8 | */ |
|---|
| 17 | 9 | |
|---|
| 18 | 10 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 42 | 34 | { |
|---|
| 43 | 35 | struct radio_isa_card *isa = video_drvdata(file); |
|---|
| 44 | 36 | |
|---|
| 45 | | - strlcpy(v->driver, isa->drv->driver.driver.name, sizeof(v->driver)); |
|---|
| 46 | | - strlcpy(v->card, isa->drv->card, sizeof(v->card)); |
|---|
| 37 | + strscpy(v->driver, isa->drv->driver.driver.name, sizeof(v->driver)); |
|---|
| 38 | + strscpy(v->card, isa->drv->card, sizeof(v->card)); |
|---|
| 47 | 39 | snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name); |
|---|
| 48 | | - |
|---|
| 49 | | - v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO; |
|---|
| 50 | | - v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS; |
|---|
| 51 | 40 | return 0; |
|---|
| 52 | 41 | } |
|---|
| 53 | 42 | |
|---|
| .. | .. |
|---|
| 60 | 49 | if (v->index > 0) |
|---|
| 61 | 50 | return -EINVAL; |
|---|
| 62 | 51 | |
|---|
| 63 | | - strlcpy(v->name, "FM", sizeof(v->name)); |
|---|
| 52 | + strscpy(v->name, "FM", sizeof(v->name)); |
|---|
| 64 | 53 | v->type = V4L2_TUNER_RADIO; |
|---|
| 65 | 54 | v->rangelow = FREQ_LOW; |
|---|
| 66 | 55 | v->rangehigh = FREQ_HIGH; |
|---|
| .. | .. |
|---|
| 198 | 187 | dev_set_drvdata(pdev, isa); |
|---|
| 199 | 188 | isa->drv = drv; |
|---|
| 200 | 189 | v4l2_dev = &isa->v4l2_dev; |
|---|
| 201 | | - strlcpy(v4l2_dev->name, dev_name(pdev), sizeof(v4l2_dev->name)); |
|---|
| 190 | + strscpy(v4l2_dev->name, dev_name(pdev), sizeof(v4l2_dev->name)); |
|---|
| 202 | 191 | |
|---|
| 203 | 192 | return isa; |
|---|
| 204 | 193 | } |
|---|
| .. | .. |
|---|
| 243 | 232 | |
|---|
| 244 | 233 | mutex_init(&isa->lock); |
|---|
| 245 | 234 | isa->vdev.lock = &isa->lock; |
|---|
| 246 | | - strlcpy(isa->vdev.name, v4l2_dev->name, sizeof(isa->vdev.name)); |
|---|
| 235 | + strscpy(isa->vdev.name, v4l2_dev->name, sizeof(isa->vdev.name)); |
|---|
| 247 | 236 | isa->vdev.v4l2_dev = v4l2_dev; |
|---|
| 248 | 237 | isa->vdev.fops = &radio_isa_fops; |
|---|
| 249 | 238 | isa->vdev.ioctl_ops = &radio_isa_ioctl_ops; |
|---|
| 250 | 239 | isa->vdev.release = video_device_release_empty; |
|---|
| 240 | + isa->vdev.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO; |
|---|
| 251 | 241 | video_set_drvdata(&isa->vdev, isa); |
|---|
| 252 | 242 | isa->freq = FREQ_LOW; |
|---|
| 253 | 243 | isa->stereo = drv->has_stereo; |
|---|