forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/misc/eeprom/max6875.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * max6875.c - driver for MAX6874/MAX6875
34 *
....@@ -20,10 +21,6 @@
2021 *
2122 * Note that the MAX6875 uses i2c_smbus_write_byte_data() to set the read
2223 * 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.
2724 */
2825
2926 #include <linux/kernel.h>
....@@ -153,9 +150,9 @@
153150 return -ENOMEM;
154151
155152 /* 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);
159156 goto exit_kfree;
160157 }
161158