| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Base driver for Marvell 88PM8607 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2009 Marvell International Ltd. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Haojian Zhuang <haojian.zhuang@marvell.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 1181 | 1178 | */ |
|---|
| 1182 | 1179 | if (pdata->companion_addr && (pdata->companion_addr != client->addr)) { |
|---|
| 1183 | 1180 | chip->companion_addr = pdata->companion_addr; |
|---|
| 1184 | | - chip->companion = i2c_new_dummy(chip->client->adapter, |
|---|
| 1181 | + chip->companion = i2c_new_dummy_device(chip->client->adapter, |
|---|
| 1185 | 1182 | chip->companion_addr); |
|---|
| 1186 | | - if (!chip->companion) { |
|---|
| 1183 | + if (IS_ERR(chip->companion)) { |
|---|
| 1187 | 1184 | dev_err(&client->dev, |
|---|
| 1188 | 1185 | "Failed to allocate I2C companion device\n"); |
|---|
| 1189 | | - return -ENODEV; |
|---|
| 1186 | + return PTR_ERR(chip->companion); |
|---|
| 1190 | 1187 | } |
|---|
| 1191 | 1188 | chip->regmap_companion = regmap_init_i2c(chip->companion, |
|---|
| 1192 | 1189 | &pm860x_regmap_config); |
|---|