forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/media/dvb-frontends/cxd2820r_core.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Sony CXD2820R demodulator driver
34 *
45 * Copyright (C) 2010 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
- *
16
- * You should have received a copy of the GNU General Public License along
17
- * with this program; if not, write to the Free Software Foundation, Inc.,
18
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
196 */
207
218
....@@ -540,16 +527,16 @@
540527 pdata.attach_in_use = true;
541528
542529 memset(&board_info, 0, sizeof(board_info));
543
- strlcpy(board_info.type, "cxd2820r", I2C_NAME_SIZE);
530
+ strscpy(board_info.type, "cxd2820r", I2C_NAME_SIZE);
544531 board_info.addr = config->i2c_address;
545532 board_info.platform_data = &pdata;
546
- client = i2c_new_device(adapter, &board_info);
547
- if (!client || !client->dev.driver)
533
+ client = i2c_new_client_device(adapter, &board_info);
534
+ if (!i2c_client_has_driver(client))
548535 return NULL;
549536
550537 return pdata.get_dvb_frontend(client);
551538 }
552
-EXPORT_SYMBOL(cxd2820r_attach);
539
+EXPORT_SYMBOL_GPL(cxd2820r_attach);
553540
554541 static struct dvb_frontend *cxd2820r_get_dvb_frontend(struct i2c_client *client)
555542 {
....@@ -645,12 +632,11 @@
645632 * one dummy I2C client in in order to get own I2C client for each
646633 * register bank.
647634 */
648
- priv->client[1] = i2c_new_dummy(client->adapter, client->addr | (1 << 1));
649
- if (!priv->client[1]) {
650
- ret = -ENODEV;
635
+ priv->client[1] = i2c_new_dummy_device(client->adapter, client->addr | (1 << 1));
636
+ if (IS_ERR(priv->client[1])) {
637
+ ret = PTR_ERR(priv->client[1]);
651638 dev_err(&client->dev, "I2C registration failed\n");
652
- if (ret)
653
- goto err_regmap_0_regmap_exit;
639
+ goto err_regmap_0_regmap_exit;
654640 }
655641
656642 priv->regmap[1] = regmap_init_i2c(priv->client[1], &regmap_config1);