hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/media/usb/dvb-usb-v2/anysee.c
....@@ -1,17 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * DVB USB Linux driver for Anysee E30 DVB-C & DVB-T USB2.0 receiver
34 *
45 * 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.
156 *
167 * TODO:
178 * - add smart card reader support for Conditional Access (CA)
....@@ -65,7 +56,7 @@
6556 /* TODO FIXME: dvb_usb_generic_rw() fails rarely with error code -32
6657 * (EPIPE, Broken pipe). Function supports currently msleep() as a
6758 * 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
6960 * short, under < 20ms, sleeps. Repeating failed message would be
7061 * better choice as not to add unwanted delays...
7162 * Fixing that correctly is one of those or both;
....@@ -211,7 +202,7 @@
211202
212203 while (i < num) {
213204 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) {
215206 ret = -EOPNOTSUPP;
216207 break;
217208 }
....@@ -327,14 +318,14 @@
327318 .deltaf = 0xba02,
328319 };
329320
330
-static struct tda18212_config anysee_tda18212_config = {
321
+static const struct tda18212_config anysee_tda18212_config = {
331322 .if_dvbt_6 = 4150,
332323 .if_dvbt_7 = 4150,
333324 .if_dvbt_8 = 4150,
334325 .if_dvbc = 5000,
335326 };
336327
337
-static struct tda18212_config anysee_tda18212_config2 = {
328
+static const struct tda18212_config anysee_tda18212_config2 = {
338329 .if_dvbt_6 = 3550,
339330 .if_dvbt_7 = 3700,
340331 .if_dvbt_8 = 4150,
....@@ -638,7 +629,7 @@
638629 .platform_data = platform_data,
639630 };
640631
641
- strlcpy(board_info.type, type, I2C_NAME_SIZE);
632
+ strscpy(board_info.type, type, I2C_NAME_SIZE);
642633
643634 /* find first free client */
644635 for (num = 0; num < ANYSEE_I2C_CLIENT_MAX; num++) {
....@@ -658,8 +649,8 @@
658649 request_module("%s", board_info.type);
659650
660651 /* 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)) {
663654 ret = -ENODEV;
664655 goto err;
665656 }