hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/dvb-frontends/ts2020.c
....@@ -1,22 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 Montage Technology TS2020 - Silicon Tuner driver
34 Copyright (C) 2009-2012 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
45
56 Copyright (C) 2009-2012 TurboSight.com
67
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
18
- along with this program; if not, write to the Free Software
19
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
208 */
219
2210 #include <media/dvb_frontend.h>
....@@ -180,6 +168,9 @@
180168 unsigned int utmp;
181169
182170 ret = regmap_read(dev->regmap, 0x3d, &utmp);
171
+ if (ret)
172
+ return ret;
173
+
183174 utmp &= 0x7f;
184175 if (utmp < 0x16)
185176 utmp = 0xa1;
....@@ -525,16 +516,16 @@
525516 pdata.attach_in_use = true;
526517
527518 memset(&board_info, 0, sizeof(board_info));
528
- strlcpy(board_info.type, "ts2020", I2C_NAME_SIZE);
519
+ strscpy(board_info.type, "ts2020", I2C_NAME_SIZE);
529520 board_info.addr = config->tuner_address;
530521 board_info.platform_data = &pdata;
531
- client = i2c_new_device(i2c, &board_info);
532
- if (!client || !client->dev.driver)
522
+ client = i2c_new_client_device(i2c, &board_info);
523
+ if (!i2c_client_has_driver(client))
533524 return NULL;
534525
535526 return fe;
536527 }
537
-EXPORT_SYMBOL(ts2020_attach);
528
+EXPORT_SYMBOL_GPL(ts2020_attach);
538529
539530 /*
540531 * We implement own regmap locking due to legacy DVB attach which uses frontend