hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/radio/radio-isa.c
....@@ -1,18 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Framework for ISA radio drivers.
34 * This takes care of all the V4L2 scaffolding, allowing the ISA drivers
45 * to concentrate on the actual hardware operation.
56 *
67 * 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.
168 */
179
1810 #include <linux/module.h>
....@@ -42,12 +34,9 @@
4234 {
4335 struct radio_isa_card *isa = video_drvdata(file);
4436
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));
4739 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;
5140 return 0;
5241 }
5342
....@@ -60,7 +49,7 @@
6049 if (v->index > 0)
6150 return -EINVAL;
6251
63
- strlcpy(v->name, "FM", sizeof(v->name));
52
+ strscpy(v->name, "FM", sizeof(v->name));
6453 v->type = V4L2_TUNER_RADIO;
6554 v->rangelow = FREQ_LOW;
6655 v->rangehigh = FREQ_HIGH;
....@@ -198,7 +187,7 @@
198187 dev_set_drvdata(pdev, isa);
199188 isa->drv = drv;
200189 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));
202191
203192 return isa;
204193 }
....@@ -243,11 +232,12 @@
243232
244233 mutex_init(&isa->lock);
245234 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));
247236 isa->vdev.v4l2_dev = v4l2_dev;
248237 isa->vdev.fops = &radio_isa_fops;
249238 isa->vdev.ioctl_ops = &radio_isa_ioctl_ops;
250239 isa->vdev.release = video_device_release_empty;
240
+ isa->vdev.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
251241 video_set_drvdata(&isa->vdev, isa);
252242 isa->freq = FREQ_LOW;
253243 isa->stereo = drv->has_stereo;