| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * max6875.c - driver for MAX6874/MAX6875 |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 20 | 21 | * |
|---|
| 21 | 22 | * Note that the MAX6875 uses i2c_smbus_write_byte_data() to set the read |
|---|
| 22 | 23 | * address, so this driver is destructive if loaded for the wrong EEPROM chip. |
|---|
| 23 | | - * |
|---|
| 24 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 25 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 26 | | - * the Free Software Foundation; version 2 of the License. |
|---|
| 27 | 24 | */ |
|---|
| 28 | 25 | |
|---|
| 29 | 26 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 153 | 150 | return -ENOMEM; |
|---|
| 154 | 151 | |
|---|
| 155 | 152 | /* A fake client is created on the odd address */ |
|---|
| 156 | | - data->fake_client = i2c_new_dummy(client->adapter, client->addr + 1); |
|---|
| 157 | | - if (!data->fake_client) { |
|---|
| 158 | | - err = -ENOMEM; |
|---|
| 153 | + data->fake_client = i2c_new_dummy_device(client->adapter, client->addr + 1); |
|---|
| 154 | + if (IS_ERR(data->fake_client)) { |
|---|
| 155 | + err = PTR_ERR(data->fake_client); |
|---|
| 159 | 156 | goto exit_kfree; |
|---|
| 160 | 157 | } |
|---|
| 161 | 158 | |
|---|