hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/media/radio/tea575x.c
....@@ -1,19 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * ALSA driver for TEA5757/5759 Philips AM/FM radio tuner chips
34 *
45 * Copyright (c) 2004 Jaroslav Kysela <perex@perex.cz>
5
- *
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
176 */
187
198 #include <linux/delay.h>
....@@ -233,14 +222,10 @@
233222 {
234223 struct snd_tea575x *tea = video_drvdata(file);
235224
236
- strlcpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
237
- strlcpy(v->card, tea->card, sizeof(v->card));
225
+ strscpy(v->driver, tea->v4l2_dev->name, sizeof(v->driver));
226
+ strscpy(v->card, tea->card, sizeof(v->card));
238227 strlcat(v->card, tea->tea5759 ? " TEA5759" : " TEA5757", sizeof(v->card));
239
- strlcpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
240
- v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
241
- if (!tea->cannot_read_data)
242
- v->device_caps |= V4L2_CAP_HW_FREQ_SEEK;
243
- v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
228
+ strscpy(v->bus_info, tea->bus_info, sizeof(v->bus_info));
244229 return 0;
245230 }
246231
....@@ -264,7 +249,7 @@
264249 index = BAND_AM;
265250 break;
266251 }
267
- /* Fall through */
252
+ fallthrough;
268253 default:
269254 return -EINVAL;
270255 }
....@@ -296,7 +281,7 @@
296281 snd_tea575x_enum_freq_bands(tea, &band_fm);
297282
298283 memset(v, 0, sizeof(*v));
299
- strlcpy(v->name, tea->has_am ? "FM/AM" : "FM", sizeof(v->name));
284
+ strscpy(v->name, tea->has_am ? "FM/AM" : "FM", sizeof(v->name));
300285 v->type = V4L2_TUNER_RADIO;
301286 v->capability = band_fm.capability;
302287 v->rangelow = tea->has_am ? bands[BAND_AM].rangelow : band_fm.rangelow;
....@@ -537,9 +522,12 @@
537522 tea->vd = tea575x_radio;
538523 video_set_drvdata(&tea->vd, tea);
539524 mutex_init(&tea->mutex);
540
- strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
525
+ strscpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
541526 tea->vd.lock = &tea->mutex;
542527 tea->vd.v4l2_dev = tea->v4l2_dev;
528
+ tea->vd.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
529
+ if (!tea->cannot_read_data)
530
+ tea->vd.device_caps |= V4L2_CAP_HW_FREQ_SEEK;
543531 tea->fops = tea575x_fops;
544532 tea->fops.owner = owner;
545533 tea->vd.fops = &tea->fops;