.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* A driver for the D-Link DSB-R100 USB radio and Gemtek USB Radio 21. |
---|
2 | 3 | * The device plugs into both the USB and an analog audio input, so this thing |
---|
3 | 4 | * only deals with initialisation and frequency setting, the |
---|
.. | .. |
---|
18 | 19 | * Fully tested with the Keene USB FM Transmitter and the v4l2-compliance tool. |
---|
19 | 20 | * |
---|
20 | 21 | * Copyright (c) 2000 Markus Demleitner <msdemlei@cl.uni-heidelberg.de> |
---|
21 | | - * |
---|
22 | | - * This program is free software; you can redistribute it and/or modify |
---|
23 | | - * it under the terms of the GNU General Public License as published by |
---|
24 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
25 | | - * (at your option) any later version. |
---|
26 | | - * |
---|
27 | | - * This program is distributed in the hope that it will be useful, |
---|
28 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
29 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
30 | | - * GNU General Public License for more details. |
---|
31 | 22 | */ |
---|
32 | 23 | |
---|
33 | 24 | #include <linux/kernel.h> |
---|
.. | .. |
---|
174 | 165 | { |
---|
175 | 166 | struct dsbr100_device *radio = video_drvdata(file); |
---|
176 | 167 | |
---|
177 | | - strlcpy(v->driver, "dsbr100", sizeof(v->driver)); |
---|
178 | | - strlcpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card)); |
---|
| 168 | + strscpy(v->driver, "dsbr100", sizeof(v->driver)); |
---|
| 169 | + strscpy(v->card, "D-Link R-100 USB FM Radio", sizeof(v->card)); |
---|
179 | 170 | usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info)); |
---|
180 | | - v->device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER; |
---|
181 | | - v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS; |
---|
182 | 171 | return 0; |
---|
183 | 172 | } |
---|
184 | 173 | |
---|
.. | .. |
---|
191 | 180 | return -EINVAL; |
---|
192 | 181 | |
---|
193 | 182 | dsbr100_getstat(radio); |
---|
194 | | - strcpy(v->name, "FM"); |
---|
| 183 | + strscpy(v->name, "FM", sizeof(v->name)); |
---|
195 | 184 | v->type = V4L2_TUNER_RADIO; |
---|
196 | 185 | v->rangelow = FREQ_MIN * FREQ_MUL; |
---|
197 | 186 | v->rangehigh = FREQ_MAX * FREQ_MUL; |
---|
.. | .. |
---|
379 | 368 | goto err_reg_ctrl; |
---|
380 | 369 | } |
---|
381 | 370 | mutex_init(&radio->v4l2_lock); |
---|
382 | | - strlcpy(radio->videodev.name, v4l2_dev->name, sizeof(radio->videodev.name)); |
---|
| 371 | + strscpy(radio->videodev.name, v4l2_dev->name, |
---|
| 372 | + sizeof(radio->videodev.name)); |
---|
383 | 373 | radio->videodev.v4l2_dev = v4l2_dev; |
---|
384 | 374 | radio->videodev.fops = &usb_dsbr100_fops; |
---|
385 | 375 | radio->videodev.ioctl_ops = &usb_dsbr100_ioctl_ops; |
---|
386 | 376 | radio->videodev.release = video_device_release_empty; |
---|
387 | 377 | radio->videodev.lock = &radio->v4l2_lock; |
---|
388 | 378 | radio->videodev.ctrl_handler = &radio->hdl; |
---|
| 379 | + radio->videodev.device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER; |
---|
389 | 380 | |
---|
390 | 381 | radio->usbdev = interface_to_usbdev(intf); |
---|
391 | 382 | radio->curfreq = FREQ_MIN * FREQ_MUL; |
---|