| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * DVB USB Linux driver for Anysee E30 DVB-C & DVB-T USB2.0 receiver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2007 Antti Palosaari <crope@iki.fi> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 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. |
|---|
| 15 | 6 | * |
|---|
| 16 | 7 | * TODO: |
|---|
| 17 | 8 | * - add smart card reader support for Conditional Access (CA) |
|---|
| .. | .. |
|---|
| 65 | 56 | /* TODO FIXME: dvb_usb_generic_rw() fails rarely with error code -32 |
|---|
| 66 | 57 | * (EPIPE, Broken pipe). Function supports currently msleep() as a |
|---|
| 67 | 58 | * parameter but I would not like to use it, since according to |
|---|
| 68 | | - * Documentation/timers/timers-howto.txt it should not be used such |
|---|
| 59 | + * Documentation/timers/timers-howto.rst it should not be used such |
|---|
| 69 | 60 | * short, under < 20ms, sleeps. Repeating failed message would be |
|---|
| 70 | 61 | * better choice as not to add unwanted delays... |
|---|
| 71 | 62 | * Fixing that correctly is one of those or both; |
|---|
| .. | .. |
|---|
| 211 | 202 | |
|---|
| 212 | 203 | while (i < num) { |
|---|
| 213 | 204 | if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) { |
|---|
| 214 | | - if (msg[i].len > 2 || msg[i+1].len > 60) { |
|---|
| 205 | + if (msg[i].len != 2 || msg[i + 1].len > 60) { |
|---|
| 215 | 206 | ret = -EOPNOTSUPP; |
|---|
| 216 | 207 | break; |
|---|
| 217 | 208 | } |
|---|
| .. | .. |
|---|
| 327 | 318 | .deltaf = 0xba02, |
|---|
| 328 | 319 | }; |
|---|
| 329 | 320 | |
|---|
| 330 | | -static struct tda18212_config anysee_tda18212_config = { |
|---|
| 321 | +static const struct tda18212_config anysee_tda18212_config = { |
|---|
| 331 | 322 | .if_dvbt_6 = 4150, |
|---|
| 332 | 323 | .if_dvbt_7 = 4150, |
|---|
| 333 | 324 | .if_dvbt_8 = 4150, |
|---|
| 334 | 325 | .if_dvbc = 5000, |
|---|
| 335 | 326 | }; |
|---|
| 336 | 327 | |
|---|
| 337 | | -static struct tda18212_config anysee_tda18212_config2 = { |
|---|
| 328 | +static const struct tda18212_config anysee_tda18212_config2 = { |
|---|
| 338 | 329 | .if_dvbt_6 = 3550, |
|---|
| 339 | 330 | .if_dvbt_7 = 3700, |
|---|
| 340 | 331 | .if_dvbt_8 = 4150, |
|---|
| .. | .. |
|---|
| 638 | 629 | .platform_data = platform_data, |
|---|
| 639 | 630 | }; |
|---|
| 640 | 631 | |
|---|
| 641 | | - strlcpy(board_info.type, type, I2C_NAME_SIZE); |
|---|
| 632 | + strscpy(board_info.type, type, I2C_NAME_SIZE); |
|---|
| 642 | 633 | |
|---|
| 643 | 634 | /* find first free client */ |
|---|
| 644 | 635 | for (num = 0; num < ANYSEE_I2C_CLIENT_MAX; num++) { |
|---|
| .. | .. |
|---|
| 658 | 649 | request_module("%s", board_info.type); |
|---|
| 659 | 650 | |
|---|
| 660 | 651 | /* register I2C device */ |
|---|
| 661 | | - client = i2c_new_device(adapter, &board_info); |
|---|
| 662 | | - if (client == NULL || client->dev.driver == NULL) { |
|---|
| 652 | + client = i2c_new_client_device(adapter, &board_info); |
|---|
| 653 | + if (!i2c_client_has_driver(client)) { |
|---|
| 663 | 654 | ret = -ENODEV; |
|---|
| 664 | 655 | goto err; |
|---|
| 665 | 656 | } |
|---|