forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/media/radio/radio-wl1273.c
....@@ -1,17 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for the Texas Instruments WL1273 FM radio.
34 *
45 * Copyright (C) 2011 Nokia Corporation
56 * Author: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * version 2 as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
157 */
168
179 #include <linux/delay.h>
....@@ -1285,20 +1277,12 @@
12851277
12861278 dev_dbg(radio->dev, "%s\n", __func__);
12871279
1288
- strlcpy(capability->driver, WL1273_FM_DRIVER_NAME,
1280
+ strscpy(capability->driver, WL1273_FM_DRIVER_NAME,
12891281 sizeof(capability->driver));
1290
- strlcpy(capability->card, "Texas Instruments Wl1273 FM Radio",
1282
+ strscpy(capability->card, "TI Wl1273 FM Radio",
12911283 sizeof(capability->card));
1292
- strlcpy(capability->bus_info, radio->bus_type,
1284
+ strscpy(capability->bus_info, radio->bus_type,
12931285 sizeof(capability->bus_info));
1294
-
1295
- capability->device_caps = V4L2_CAP_HW_FREQ_SEEK |
1296
- V4L2_CAP_TUNER | V4L2_CAP_RADIO | V4L2_CAP_AUDIO |
1297
- V4L2_CAP_RDS_CAPTURE | V4L2_CAP_MODULATOR |
1298
- V4L2_CAP_RDS_OUTPUT;
1299
- capability->capabilities = capability->device_caps |
1300
- V4L2_CAP_DEVICE_CAPS;
1301
-
13021286 return 0;
13031287 }
13041288
....@@ -1487,7 +1471,7 @@
14871471 if (audio->index > 1)
14881472 return -EINVAL;
14891473
1490
- strlcpy(audio->name, "Radio", sizeof(audio->name));
1474
+ strscpy(audio->name, "Radio", sizeof(audio->name));
14911475 audio->capability = V4L2_AUDCAP_STEREO;
14921476
14931477 return 0;
....@@ -1522,7 +1506,7 @@
15221506 if (tuner->index > 0)
15231507 return -EINVAL;
15241508
1525
- strlcpy(tuner->name, WL1273_FM_DRIVER_NAME, sizeof(tuner->name));
1509
+ strscpy(tuner->name, WL1273_FM_DRIVER_NAME, sizeof(tuner->name));
15261510 tuner->type = V4L2_TUNER_RADIO;
15271511
15281512 tuner->rangelow = WL1273_FREQ(WL1273_BAND_JAPAN_LOW);
....@@ -1780,7 +1764,7 @@
17801764
17811765 dev_dbg(radio->dev, "%s\n", __func__);
17821766
1783
- strlcpy(modulator->name, WL1273_FM_DRIVER_NAME,
1767
+ strscpy(modulator->name, WL1273_FM_DRIVER_NAME,
17841768 sizeof(modulator->name));
17851769
17861770 modulator->rangelow = WL1273_FREQ(WL1273_BAND_JAPAN_LOW);
....@@ -1987,6 +1971,10 @@
19871971 .name = WL1273_FM_DRIVER_NAME,
19881972 .release = wl1273_vdev_release,
19891973 .vfl_dir = VFL_DIR_TX,
1974
+ .device_caps = V4L2_CAP_HW_FREQ_SEEK | V4L2_CAP_TUNER |
1975
+ V4L2_CAP_RADIO | V4L2_CAP_AUDIO |
1976
+ V4L2_CAP_RDS_CAPTURE | V4L2_CAP_MODULATOR |
1977
+ V4L2_CAP_RDS_OUTPUT,
19901978 };
19911979
19921980 static int wl1273_fm_radio_remove(struct platform_device *pdev)