Revert "i2c: scmi: Replace open coded device_get_match_data()"
PATCH 1/1 Revert "i2c: scmi: Replace open coded device_get_match_data()"
This reverts commit 9ae551ded5ba55f96a83cd0811f7ef8c2f329d0c. We got a regression report, so ensure this machine boots again. We will come back with a better version hopefully.
Signed-off-by Wolfram Sang <[email protected]>
--- drivers/i2c/busses/i2c-scmi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-scmi.c +7 -2
@@ -30,7 +30,7 @@ struct acpi_smbus_cmi { u8 cap_info:1; u8 cap_read:1; u8 cap_write:1; -const struct smbus_methods_t *methods; +struct smbus_methods_t *methods; };static const struct smbus_methods_t smbus_methods = {
@@ -361,6 +361,7 @@ static acpi_status acpi_smbus_cmi_query_methods(acpi_handle handle, u32 level,static int acpi_smbus_cmi_add (struct acpi_device *device) {struct acpi_smbus_cmi *smbus_cmi; +const struct acpi_device_id *id;int ret; smbus_cmi =kzalloc (sizeof (struct acpi_smbus_cmi ),GFP_KERNEL );
@@ -368,7 +369,6 @@ static int acpi_smbus_cmi_add(struct acpi_device *device)return -ENOMEM ; smbus_cmi->handle = device->handle; - smbus_cmi->methods =device_get_match_data (&device->dev);strcpy (acpi_device_name (device),ACPI_SMBUS_HC_DEVICE_NAME );strcpy (acpi_device_class (device),ACPI_SMBUS_HC_CLASS ); device->driver_data = smbus_cmi;
@@ -376,6 +376,11 @@ 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; +acpi_walk_namespace (ACPI_TYPE_METHOD , smbus_cmi->handle,1 , acpi_smbus_cmi_query_methods,NULL , smbus_cmi,NULL );
Signature · 1 line
2.35.1
Wolfram Sang
AppliedQuoted 6 lines · Wolfram Sang
This reverts commit
9ae551ded5ba55f96a83cd0811f7ef8c2f329d0c. We got a regression report, so ensure this machine boots again. We will come back with a better version hopefully.
Applied to for-current, thanks!
Quoted 4 lines
Quoted 2 lines
Applied to for-current, thanks!
Added Reported-by tag from Josef, well deserved!
Quoted 6 lines · Wolfram Sang
Quoted 4 lines
Quoted 2 lines
Applied to for-current, thanks!
Added Reported-by tag from Josef, well deserved!
Ah, revert is there, thanks. I will respin then with checking the case Josef reported about.
Signature · 2 lines
With Best Regards, Andy Shevchenko