hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/radio/dsbr100.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* A driver for the D-Link DSB-R100 USB radio and Gemtek USB Radio 21.
23 * The device plugs into both the USB and an analog audio input, so this thing
34 * only deals with initialisation and frequency setting, the
....@@ -18,16 +19,6 @@
1819 * Fully tested with the Keene USB FM Transmitter and the v4l2-compliance tool.
1920 *
2021 * 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.
3122 */
3223
3324 #include <linux/kernel.h>
....@@ -174,11 +165,9 @@
174165 {
175166 struct dsbr100_device *radio = video_drvdata(file);
176167
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));
179170 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;
182171 return 0;
183172 }
184173
....@@ -191,7 +180,7 @@
191180 return -EINVAL;
192181
193182 dsbr100_getstat(radio);
194
- strcpy(v->name, "FM");
183
+ strscpy(v->name, "FM", sizeof(v->name));
195184 v->type = V4L2_TUNER_RADIO;
196185 v->rangelow = FREQ_MIN * FREQ_MUL;
197186 v->rangehigh = FREQ_MAX * FREQ_MUL;
....@@ -379,13 +368,15 @@
379368 goto err_reg_ctrl;
380369 }
381370 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));
383373 radio->videodev.v4l2_dev = v4l2_dev;
384374 radio->videodev.fops = &usb_dsbr100_fops;
385375 radio->videodev.ioctl_ops = &usb_dsbr100_ioctl_ops;
386376 radio->videodev.release = video_device_release_empty;
387377 radio->videodev.lock = &radio->v4l2_lock;
388378 radio->videodev.ctrl_handler = &radio->hdl;
379
+ radio->videodev.device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER;
389380
390381 radio->usbdev = interface_to_usbdev(intf);
391382 radio->curfreq = FREQ_MIN * FREQ_MUL;