Skip to contentSkip to conversation

x86: convert to use new I2C API

PATCH In review Wolfram Sang 2 participants 4 messages Mar 26, 2020 – May 12, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover x86: convert to use new I2C API

We are deprecating calls which return NULL in favor of new variants which return an ERR_PTR. Only build tested.

Wolfram Sang (1):
x86/platform/intel-mid: convert to use i2c_new_client_device()

 arch/x86/platform/intel-mid/sfi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 x86/platform/intel-mid: convert to use i2c_new_client_device()

Move away from the deprecated API and return the shiny new ERRPTR where useful.

---
 arch/x86/platform/intel-mid/sfi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/platform/intel-mid/sfi.c +2 -2
index b8f7f193f383..30bd5714a3d4 100644
@@ -287,8 +287,8 @@ void intel_scu_devices_create(void)
 
 		adapter = i2c_get_adapter(i2c_bus[i]);
 		if (adapter) {
-			client = i2c_new_device(adapter, i2c_devs[i]);
-			if (!client)
+			client = i2c_new_client_device(adapter, i2c_devs[i]);
+			if (IS_ERR(client))
 				pr_err("can't create i2c device %s\n",
 					i2c_devs[i]->type);
 		} else
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#2 lore raw

Re: [PATCH 1/1] x86/platform/intel-mid: convert to use i2c_new_client_device()

Quoted 4 lines · Wolfram Sang

Move away from the deprecated API and return the shiny new ERRPTR where useful.

Quoted 23 lines
---
 arch/x86/platform/intel-mid/sfi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/platform/intel-mid/sfi.c +2 -3
index b8f7f193f383..30bd5714a3d4 100644
@@ -287,8 +287,8 @@ void intel_scu_devices_create(void)
 
                adapter = i2c_get_adapter(i2c_bus[i]);
                if (adapter) {
-                       client = i2c_new_device(adapter, i2c_devs[i]);
-                       if (!client)
+                       client = i2c_new_client_device(adapter, i2c_devs[i]);
+                       if (IS_ERR(client))
                                pr_err("can't create i2c device %s\n",
                                        i2c_devs[i]->type);
                } else
--

2.20.1

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw

Re: [PATCH 1/1] x86/platform/intel-mid: convert to use i2c_new_client_device()

In reply to Wolfram Sang
Quoted 5 lines · Wolfram Sang

Move away from the deprecated API and return the shiny new ERRPTR where useful.

---

Can we have this now so I can remove the old API in the next merge window? Andy already reviewed it. Thanks!

Quoted 21 lines
 arch/x86/platform/intel-mid/sfi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/platform/intel-mid/sfi.c +2 -2
index b8f7f193f383..30bd5714a3d4 100644
@@ -287,8 +287,8 @@ void intel_scu_devices_create(void)
 
 		adapter = i2c_get_adapter(i2c_bus[i]);
 		if (adapter) {
-			client = i2c_new_device(adapter, i2c_devs[i]);
-			if (!client)
+			client = i2c_new_client_device(adapter, i2c_devs[i]);
+			if (IS_ERR(client))
 				pr_err("can't create i2c device %s\n",
 					i2c_devs[i]->type);
 		} else
Signature · 1 line
2.20.1