| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ALSA driver for TEA5757/5759 Philips AM/FM radio tuner chips |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 | | - * |
|---|
| 17 | 6 | */ |
|---|
| 18 | 7 | |
|---|
| 19 | 8 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 233 | 222 | { |
|---|
| 234 | 223 | struct snd_tea575x *tea = video_drvdata(file); |
|---|
| 235 | 224 | |
|---|
| 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)); |
|---|
| 238 | 227 | 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)); |
|---|
| 244 | 229 | return 0; |
|---|
| 245 | 230 | } |
|---|
| 246 | 231 | |
|---|
| .. | .. |
|---|
| 264 | 249 | index = BAND_AM; |
|---|
| 265 | 250 | break; |
|---|
| 266 | 251 | } |
|---|
| 267 | | - /* Fall through */ |
|---|
| 252 | + fallthrough; |
|---|
| 268 | 253 | default: |
|---|
| 269 | 254 | return -EINVAL; |
|---|
| 270 | 255 | } |
|---|
| .. | .. |
|---|
| 296 | 281 | snd_tea575x_enum_freq_bands(tea, &band_fm); |
|---|
| 297 | 282 | |
|---|
| 298 | 283 | 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)); |
|---|
| 300 | 285 | v->type = V4L2_TUNER_RADIO; |
|---|
| 301 | 286 | v->capability = band_fm.capability; |
|---|
| 302 | 287 | v->rangelow = tea->has_am ? bands[BAND_AM].rangelow : band_fm.rangelow; |
|---|
| .. | .. |
|---|
| 537 | 522 | tea->vd = tea575x_radio; |
|---|
| 538 | 523 | video_set_drvdata(&tea->vd, tea); |
|---|
| 539 | 524 | 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)); |
|---|
| 541 | 526 | tea->vd.lock = &tea->mutex; |
|---|
| 542 | 527 | 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; |
|---|
| 543 | 531 | tea->fops = tea575x_fops; |
|---|
| 544 | 532 | tea->fops.owner = owner; |
|---|
| 545 | 533 | tea->vd.fops = &tea->fops; |
|---|