| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Panasonic MN88472 DVB-T/T2/C demodulator driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2013 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 "mn88472_priv.h" |
|---|
| .. | .. |
|---|
| 621 | 612 | * Also, register bank 2 do not support sequential I/O. Only single |
|---|
| 622 | 613 | * register write or read is allowed to that bank. |
|---|
| 623 | 614 | */ |
|---|
| 624 | | - dev->client[1] = i2c_new_dummy(client->adapter, 0x1a); |
|---|
| 625 | | - if (!dev->client[1]) { |
|---|
| 626 | | - ret = -ENODEV; |
|---|
| 615 | + dev->client[1] = i2c_new_dummy_device(client->adapter, 0x1a); |
|---|
| 616 | + if (IS_ERR(dev->client[1])) { |
|---|
| 617 | + ret = PTR_ERR(dev->client[1]); |
|---|
| 627 | 618 | dev_err(&client->dev, "I2C registration failed\n"); |
|---|
| 628 | | - if (ret) |
|---|
| 629 | | - goto err_regmap_0_regmap_exit; |
|---|
| 619 | + goto err_regmap_0_regmap_exit; |
|---|
| 630 | 620 | } |
|---|
| 631 | 621 | dev->regmap[1] = regmap_init_i2c(dev->client[1], ®map_config); |
|---|
| 632 | 622 | if (IS_ERR(dev->regmap[1])) { |
|---|
| .. | .. |
|---|
| 635 | 625 | } |
|---|
| 636 | 626 | i2c_set_clientdata(dev->client[1], dev); |
|---|
| 637 | 627 | |
|---|
| 638 | | - dev->client[2] = i2c_new_dummy(client->adapter, 0x1c); |
|---|
| 639 | | - if (!dev->client[2]) { |
|---|
| 640 | | - ret = -ENODEV; |
|---|
| 628 | + dev->client[2] = i2c_new_dummy_device(client->adapter, 0x1c); |
|---|
| 629 | + if (IS_ERR(dev->client[2])) { |
|---|
| 630 | + ret = PTR_ERR(dev->client[2]); |
|---|
| 641 | 631 | dev_err(&client->dev, "2nd I2C registration failed\n"); |
|---|
| 642 | | - if (ret) |
|---|
| 643 | | - goto err_regmap_1_regmap_exit; |
|---|
| 632 | + goto err_regmap_1_regmap_exit; |
|---|
| 644 | 633 | } |
|---|
| 645 | 634 | dev->regmap[2] = regmap_init_i2c(dev->client[2], ®map_config); |
|---|
| 646 | 635 | if (IS_ERR(dev->regmap[2])) { |
|---|