Commit 9ae551de authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Wolfram Sang

i2c: scmi: Replace open coded device_get_match_data()

Replace open coded device_get_match_data() in acpi_smbus_cmi_add().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent d4d2f170
...@@ -30,7 +30,7 @@ struct acpi_smbus_cmi { ...@@ -30,7 +30,7 @@ struct acpi_smbus_cmi {
u8 cap_info:1; u8 cap_info:1;
u8 cap_read:1; u8 cap_read:1;
u8 cap_write:1; u8 cap_write:1;
struct smbus_methods_t *methods; const struct smbus_methods_t *methods;
}; };
static const struct smbus_methods_t smbus_methods = { static const struct smbus_methods_t smbus_methods = {
...@@ -361,7 +361,6 @@ static acpi_status acpi_smbus_cmi_query_methods(acpi_handle handle, u32 level, ...@@ -361,7 +361,6 @@ static acpi_status acpi_smbus_cmi_query_methods(acpi_handle handle, u32 level,
static int acpi_smbus_cmi_add(struct acpi_device *device) static int acpi_smbus_cmi_add(struct acpi_device *device)
{ {
struct acpi_smbus_cmi *smbus_cmi; struct acpi_smbus_cmi *smbus_cmi;
const struct acpi_device_id *id;
int ret; int ret;
smbus_cmi = kzalloc(sizeof(struct acpi_smbus_cmi), GFP_KERNEL); smbus_cmi = kzalloc(sizeof(struct acpi_smbus_cmi), GFP_KERNEL);
...@@ -369,6 +368,7 @@ static int acpi_smbus_cmi_add(struct acpi_device *device) ...@@ -369,6 +368,7 @@ static int acpi_smbus_cmi_add(struct acpi_device *device)
return -ENOMEM; return -ENOMEM;
smbus_cmi->handle = device->handle; 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_name(device), ACPI_SMBUS_HC_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_SMBUS_HC_CLASS); strcpy(acpi_device_class(device), ACPI_SMBUS_HC_CLASS);
device->driver_data = smbus_cmi; device->driver_data = smbus_cmi;
...@@ -376,11 +376,6 @@ static int acpi_smbus_cmi_add(struct acpi_device *device) ...@@ -376,11 +376,6 @@ static int acpi_smbus_cmi_add(struct acpi_device *device)
smbus_cmi->cap_read = 0; smbus_cmi->cap_read = 0;
smbus_cmi->cap_write = 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_walk_namespace(ACPI_TYPE_METHOD, smbus_cmi->handle, 1,
acpi_smbus_cmi_query_methods, NULL, smbus_cmi, NULL); acpi_smbus_cmi_query_methods, NULL, smbus_cmi, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment