hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/radio/radio-ma901.c
....@@ -1,19 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for the MasterKit MA901 USB FM radio. This device plugs
34 * into the USB port and an analog audio input or headphones, so this thing
45 * only deals with initialization, frequency setting, volume.
56 *
67 * 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.
178 */
189
1910 #include <linux/kernel.h>
....@@ -197,11 +188,9 @@
197188 {
198189 struct ma901radio_device *radio = video_drvdata(file);
199190
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));
202193 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;
205194 return 0;
206195 }
207196
....@@ -222,7 +211,7 @@
222211 * retval = ma901radio_get_stat(radio, &is_stereo, &v->signal);
223212 */
224213
225
- strcpy(v->name, "FM");
214
+ strscpy(v->name, "FM", sizeof(v->name));
226215 v->type = V4L2_TUNER_RADIO;
227216 v->rangelow = FREQ_MIN * FREQ_MUL;
228217 v->rangehigh = FREQ_MAX * FREQ_MUL;
....@@ -400,13 +389,14 @@
400389
401390 radio->v4l2_dev.ctrl_handler = &radio->hdl;
402391 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,
404393 sizeof(radio->vdev.name));
405394 radio->vdev.v4l2_dev = &radio->v4l2_dev;
406395 radio->vdev.fops = &usb_ma901radio_fops;
407396 radio->vdev.ioctl_ops = &usb_ma901radio_ioctl_ops;
408397 radio->vdev.release = video_device_release_empty;
409398 radio->vdev.lock = &radio->lock;
399
+ radio->vdev.device_caps = V4L2_CAP_RADIO | V4L2_CAP_TUNER;
410400
411401 radio->usbdev = interface_to_usbdev(intf);
412402 radio->intf = intf;