hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/radio/radio-timb.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * radio-timb.c Timberdale FPGA Radio driver
34 * Copyright (c) 2009 Intel Corporation
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
135 */
146
157 #include <linux/io.h>
....@@ -39,11 +31,9 @@
3931 static int timbradio_vidioc_querycap(struct file *file, void *priv,
4032 struct v4l2_capability *v)
4133 {
42
- strlcpy(v->driver, DRIVER_NAME, sizeof(v->driver));
43
- strlcpy(v->card, "Timberdale Radio", sizeof(v->card));
34
+ strscpy(v->driver, DRIVER_NAME, sizeof(v->driver));
35
+ strscpy(v->card, "Timberdale Radio", sizeof(v->card));
4436 snprintf(v->bus_info, sizeof(v->bus_info), "platform:"DRIVER_NAME);
45
- v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
46
- v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
4737 return 0;
4838 }
4939
....@@ -115,15 +105,16 @@
115105 tr->pdata = *pdata;
116106 mutex_init(&tr->lock);
117107
118
- strlcpy(tr->video_dev.name, "Timberdale Radio",
108
+ strscpy(tr->video_dev.name, "Timberdale Radio",
119109 sizeof(tr->video_dev.name));
120110 tr->video_dev.fops = &timbradio_fops;
121111 tr->video_dev.ioctl_ops = &timbradio_ioctl_ops;
122112 tr->video_dev.release = video_device_release_empty;
123113 tr->video_dev.minor = -1;
124114 tr->video_dev.lock = &tr->lock;
115
+ tr->video_dev.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
125116
126
- strlcpy(tr->v4l2_dev.name, DRIVER_NAME, sizeof(tr->v4l2_dev.name));
117
+ strscpy(tr->v4l2_dev.name, DRIVER_NAME, sizeof(tr->v4l2_dev.name));
127118 err = v4l2_device_register(NULL, &tr->v4l2_dev);
128119 if (err)
129120 goto err;