forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
....@@ -1,22 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * DVB USB framework
34 *
45 * Copyright (C) 2004-6 Patrick Boettcher <patrick.boettcher@posteo.de>
56 * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
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
- * You should have received a copy of the GNU General Public License along
18
- * with this program; if not, write to the Free Software Foundation, Inc.,
19
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
207 */
218
229 #include "dvb_usb_common.h"
....@@ -74,7 +61,7 @@
7461 if (!d->props->i2c_algo)
7562 return 0;
7663
77
- strlcpy(d->i2c_adap.name, d->name, sizeof(d->i2c_adap.name));
64
+ strscpy(d->i2c_adap.name, d->name, sizeof(d->i2c_adap.name));
7865 d->i2c_adap.algo = d->props->i2c_algo;
7966 d->i2c_adap.dev.parent = &d->udev->dev;
8067 i2c_set_adapdata(&d->i2c_adap, d);
....@@ -163,6 +150,7 @@
163150 dev->map_name = d->rc.map_name;
164151 dev->allowed_protocols = d->rc.allowed_protos;
165152 dev->change_protocol = d->rc.change_protocol;
153
+ dev->timeout = d->rc.timeout;
166154 dev->priv = d;
167155
168156 ret = rc_register_device(dev);
....@@ -957,9 +945,7 @@
957945 if (d->props->identify_state) {
958946 const char *name = NULL;
959947 ret = d->props->identify_state(d, &name);
960
- if (ret == 0) {
961
- ;
962
- } else if (ret == COLD) {
948
+ if (ret == COLD) {
963949 dev_info(&d->udev->dev,
964950 "%s: found a '%s' in cold state\n",
965951 KBUILD_MODNAME, d->name);
....@@ -984,7 +970,7 @@
984970 } else {
985971 goto err_free_all;
986972 }
987
- } else {
973
+ } else if (ret != WARM) {
988974 goto err_free_all;
989975 }
990976 }