.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for the MasterKit MA901 USB FM radio. This device plugs |
---|
3 | 4 | * into the USB port and an analog audio input or headphones, so this thing |
---|
4 | 5 | * only deals with initialization, frequency setting, volume. |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (c) 2012 Alexey Klimov <klimov.linux@gmail.com> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License as published by |
---|
10 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
11 | | - * (at your option) any later version. |
---|
12 | | - * |
---|
13 | | - * This program is distributed in the hope that it will be useful, |
---|
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | | - * GNU General Public License for more details. |
---|
17 | 8 | */ |
---|
18 | 9 | |
---|
19 | 10 | #include <linux/kernel.h> |
---|
.. | .. |
---|
197 | 188 | { |
---|
198 | 189 | struct ma901radio_device *radio = video_drvdata(file); |
---|
199 | 190 | |
---|
200 | | - strlcpy(v->driver, "radio-ma901", sizeof(v->driver)); |
---|
201 | | - strlcpy(v->card, "Masterkit MA901 USB FM Radio", sizeof(v->card)); |
---|
| 191 | + strscpy(v->driver, "radio-ma901", sizeof(v->driver)); |
---|
| 192 | + strscpy(v->card, "Masterkit MA901 USB FM Radio", sizeof(v->card)); |
---|
202 | 193 | usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info)); |
---|
203 | | - v->device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER; |
---|
204 | | - v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS; |
---|
205 | 194 | return 0; |
---|
206 | 195 | } |
---|
207 | 196 | |
---|
.. | .. |
---|
222 | 211 | * retval = ma901radio_get_stat(radio, &is_stereo, &v->signal); |
---|
223 | 212 | */ |
---|
224 | 213 | |
---|
225 | | - strcpy(v->name, "FM"); |
---|
| 214 | + strscpy(v->name, "FM", sizeof(v->name)); |
---|
226 | 215 | v->type = V4L2_TUNER_RADIO; |
---|
227 | 216 | v->rangelow = FREQ_MIN * FREQ_MUL; |
---|
228 | 217 | v->rangehigh = FREQ_MAX * FREQ_MUL; |
---|
.. | .. |
---|
400 | 389 | |
---|
401 | 390 | radio->v4l2_dev.ctrl_handler = &radio->hdl; |
---|
402 | 391 | radio->v4l2_dev.release = usb_ma901radio_release; |
---|
403 | | - strlcpy(radio->vdev.name, radio->v4l2_dev.name, |
---|
| 392 | + strscpy(radio->vdev.name, radio->v4l2_dev.name, |
---|
404 | 393 | sizeof(radio->vdev.name)); |
---|
405 | 394 | radio->vdev.v4l2_dev = &radio->v4l2_dev; |
---|
406 | 395 | radio->vdev.fops = &usb_ma901radio_fops; |
---|
407 | 396 | radio->vdev.ioctl_ops = &usb_ma901radio_ioctl_ops; |
---|
408 | 397 | radio->vdev.release = video_device_release_empty; |
---|
409 | 398 | radio->vdev.lock = &radio->lock; |
---|
| 399 | + radio->vdev.device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER; |
---|
410 | 400 | |
---|
411 | 401 | radio->usbdev = interface_to_usbdev(intf); |
---|
412 | 402 | radio->intf = intf; |
---|