forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/media/radio/radio-tea5764.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * driver/media/radio/radio-tea5764.c
34 *
....@@ -8,16 +9,6 @@
89 * Based in radio-tea5761.c Copyright (C) 2005 Nokia Corporation
910 *
1011 * Copyright (c) 2008 Fabio Belavenuto <belavenuto@gmail.com>
11
- *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License as published by
14
- * the Free Software Foundation; either version 2 of the License, or
15
- * (at your option) any later version.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
2112 *
2213 * History:
2314 * 2008-12-06 Fabio Belavenuto <belavenuto@gmail.com>
....@@ -287,12 +278,10 @@
287278 struct tea5764_device *radio = video_drvdata(file);
288279 struct video_device *dev = &radio->vdev;
289280
290
- strlcpy(v->driver, dev->dev.driver->name, sizeof(v->driver));
291
- strlcpy(v->card, dev->name, sizeof(v->card));
281
+ strscpy(v->driver, dev->dev.driver->name, sizeof(v->driver));
282
+ strscpy(v->card, dev->name, sizeof(v->card));
292283 snprintf(v->bus_info, sizeof(v->bus_info),
293284 "I2C:%s", dev_name(&dev->dev));
294
- v->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
295
- v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS;
296285 return 0;
297286 }
298287
....@@ -305,7 +294,7 @@
305294 if (v->index > 0)
306295 return -EINVAL;
307296
308
- strlcpy(v->name, "FM", sizeof(v->name));
297
+ strscpy(v->name, "FM", sizeof(v->name));
309298 v->type = V4L2_TUNER_RADIO;
310299 tea5764_i2c_read(radio);
311300 v->rangelow = FREQ_MIN * FREQ_MUL;
....@@ -474,6 +463,7 @@
474463 video_set_drvdata(&radio->vdev, radio);
475464 radio->vdev.lock = &radio->mutex;
476465 radio->vdev.v4l2_dev = v4l2_dev;
466
+ radio->vdev.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO;
477467
478468 /* initialize and power off the chip */
479469 tea5764_i2c_read(radio);