diff mbox series

[v1,1/1] i2c: scmi: Replace open coded acpi_match_device()

Message ID 20220630195541.4368-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/1] i2c: scmi: Replace open coded acpi_match_device() | expand

Commit Message

Andy Shevchenko June 30, 2022, 7:55 p.m. UTC
Replace open coded acpi_match_device() in acpi_smbus_cmi_add().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-scmi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Wolfram Sang July 6, 2022, 7:32 p.m. UTC | #1
> Discard this, a last minute change that makes it not buildable.

Do you plan to send an update?
Andy Shevchenko July 8, 2022, 10:02 a.m. UTC | #2
On Wed, Jul 06, 2022 at 09:32:05PM +0200, Wolfram Sang wrote:
> 
> > Discard this, a last minute change that makes it not buildable.
> 
> Do you plan to send an update?

Just did it.
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-scmi.c b/drivers/i2c/busses/i2c-scmi.c
index 6746aa46d96c..ba20f6c60e06 100644
--- a/drivers/i2c/busses/i2c-scmi.c
+++ b/drivers/i2c/busses/i2c-scmi.c
@@ -376,10 +376,9 @@  static int acpi_smbus_cmi_add(struct acpi_device *device)
 	smbus_cmi->cap_read = 0;
 	smbus_cmi->cap_write = 0;
 
-	for (id = acpi_smbus_cmi_ids; id->id[0]; id++)
-		if (!strcmp(id->id, acpi_device_hid(device)))
-			smbus_cmi->methods =
-				(struct smbus_methods_t *) id->driver_data;
+	id = acpi_match_device(device, acpi_smbus_cmi_ids);
+	if (id)
+		smbus_cmi->methods = (struct smbus_methods_t *)id->driver_data;
 
 	acpi_walk_namespace(ACPI_TYPE_METHOD, smbus_cmi->handle, 1,
 			    acpi_smbus_cmi_query_methods, NULL, smbus_cmi, NULL);