hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/media/radio/radio-tea5777.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * v4l2 driver for TEA5777 Philips AM/FM radio tuner chips
34 *
....@@ -6,17 +7,6 @@
67 * Based on the ALSA driver for TEA5757/5759 Philips AM/FM radio tuner chips:
78 *
89 * Copyright (c) 2004 Jaroslav Kysela <perex@perex.cz>
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
2010 */
2111
2212 #include <linux/delay.h>
....@@ -266,13 +256,10 @@
266256 {
267257 struct radio_tea5777 *tea = video_drvdata(file);
268258
269
- strlcpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
270
- strlcpy(v->card, tea->card, sizeof(v->card));
259
+ strscpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
260
+ strscpy(v->card, tea->card, sizeof(v->card));
271261 strlcat(v->card, " TEA5777", sizeof(v->card));
272
- strlcpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
273
- v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
274
- v->device_caps |= V4L2_CAP_HW_FREQ_SEEK;
275
- v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
262
+ strscpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
276263 return 0;
277264 }
278265
....@@ -304,9 +291,9 @@
304291
305292 memset(v, 0, sizeof(*v));
306293 if (tea->has_am)
307
- strlcpy(v->name, "AM/FM", sizeof(v->name));
294
+ strscpy(v->name, "AM/FM", sizeof(v->name));
308295 else
309
- strlcpy(v->name, "FM", sizeof(v->name));
296
+ strscpy(v->name, "FM", sizeof(v->name));
310297 v->type = V4L2_TUNER_RADIO;
311298 v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
312299 V4L2_TUNER_CAP_FREQ_BANDS |
....@@ -560,9 +547,11 @@
560547 tea->vd = tea575x_radio;
561548 video_set_drvdata(&tea->vd, tea);
562549 mutex_init(&tea->mutex);
563
- strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
550
+ strscpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
564551 tea->vd.lock = &tea->mutex;
565552 tea->vd.v4l2_dev = tea->v4l2_dev;
553
+ tea->vd.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO |
554
+ V4L2_CAP_HW_FREQ_SEEK;
566555 tea->fops = tea575x_fops;
567556 tea->fops.owner = owner;
568557 tea->vd.fops = &tea->fops;