| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Panasonic MN88473 DVB-T/T2/C demodulator driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2014 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 | |
|---|
| 17 | 8 | #include "mn88473_priv.h" |
|---|
| .. | .. |
|---|
| 666 | 657 | * Also, register bank 2 do not support sequential I/O. Only single |
|---|
| 667 | 658 | * register write or read is allowed to that bank. |
|---|
| 668 | 659 | */ |
|---|
| 669 | | - dev->client[1] = i2c_new_dummy(client->adapter, 0x1a); |
|---|
| 670 | | - if (dev->client[1] == NULL) { |
|---|
| 671 | | - ret = -ENODEV; |
|---|
| 660 | + dev->client[1] = i2c_new_dummy_device(client->adapter, 0x1a); |
|---|
| 661 | + if (IS_ERR(dev->client[1])) { |
|---|
| 662 | + ret = PTR_ERR(dev->client[1]); |
|---|
| 672 | 663 | dev_err(&client->dev, "I2C registration failed\n"); |
|---|
| 673 | | - if (ret) |
|---|
| 674 | | - goto err_regmap_0_regmap_exit; |
|---|
| 664 | + goto err_regmap_0_regmap_exit; |
|---|
| 675 | 665 | } |
|---|
| 676 | 666 | dev->regmap[1] = regmap_init_i2c(dev->client[1], ®map_config); |
|---|
| 677 | 667 | if (IS_ERR(dev->regmap[1])) { |
|---|
| .. | .. |
|---|
| 680 | 670 | } |
|---|
| 681 | 671 | i2c_set_clientdata(dev->client[1], dev); |
|---|
| 682 | 672 | |
|---|
| 683 | | - dev->client[2] = i2c_new_dummy(client->adapter, 0x1c); |
|---|
| 684 | | - if (dev->client[2] == NULL) { |
|---|
| 685 | | - ret = -ENODEV; |
|---|
| 673 | + dev->client[2] = i2c_new_dummy_device(client->adapter, 0x1c); |
|---|
| 674 | + if (IS_ERR(dev->client[2])) { |
|---|
| 675 | + ret = PTR_ERR(dev->client[2]); |
|---|
| 686 | 676 | dev_err(&client->dev, "2nd I2C registration failed\n"); |
|---|
| 687 | | - if (ret) |
|---|
| 688 | | - goto err_regmap_1_regmap_exit; |
|---|
| 677 | + goto err_regmap_1_regmap_exit; |
|---|
| 689 | 678 | } |
|---|
| 690 | 679 | dev->regmap[2] = regmap_init_i2c(dev->client[2], ®map_config); |
|---|
| 691 | 680 | if (IS_ERR(dev->regmap[2])) { |
|---|