| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * v4l2 driver for TEA5777 Philips AM/FM radio tuner chips |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Based on the ALSA driver for TEA5757/5759 Philips AM/FM radio tuner chips: |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * 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 | | - * |
|---|
| 20 | 10 | */ |
|---|
| 21 | 11 | |
|---|
| 22 | 12 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 266 | 256 | { |
|---|
| 267 | 257 | struct radio_tea5777 *tea = video_drvdata(file); |
|---|
| 268 | 258 | |
|---|
| 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)); |
|---|
| 271 | 261 | 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)); |
|---|
| 276 | 263 | return 0; |
|---|
| 277 | 264 | } |
|---|
| 278 | 265 | |
|---|
| .. | .. |
|---|
| 304 | 291 | |
|---|
| 305 | 292 | memset(v, 0, sizeof(*v)); |
|---|
| 306 | 293 | if (tea->has_am) |
|---|
| 307 | | - strlcpy(v->name, "AM/FM", sizeof(v->name)); |
|---|
| 294 | + strscpy(v->name, "AM/FM", sizeof(v->name)); |
|---|
| 308 | 295 | else |
|---|
| 309 | | - strlcpy(v->name, "FM", sizeof(v->name)); |
|---|
| 296 | + strscpy(v->name, "FM", sizeof(v->name)); |
|---|
| 310 | 297 | v->type = V4L2_TUNER_RADIO; |
|---|
| 311 | 298 | v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | |
|---|
| 312 | 299 | V4L2_TUNER_CAP_FREQ_BANDS | |
|---|
| .. | .. |
|---|
| 560 | 547 | tea->vd = tea575x_radio; |
|---|
| 561 | 548 | video_set_drvdata(&tea->vd, tea); |
|---|
| 562 | 549 | 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)); |
|---|
| 564 | 551 | tea->vd.lock = &tea->mutex; |
|---|
| 565 | 552 | tea->vd.v4l2_dev = tea->v4l2_dev; |
|---|
| 553 | + tea->vd.device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO | |
|---|
| 554 | + V4L2_CAP_HW_FREQ_SEEK; |
|---|
| 566 | 555 | tea->fops = tea575x_fops; |
|---|
| 567 | 556 | tea->fops.owner = owner; |
|---|
| 568 | 557 | tea->vd.fops = &tea->fops; |
|---|