Commit b8632785 authored by Patrick Mochel's avatar Patrick Mochel Committed by Len Brown

ACPI: acpi_memhotplug: Use acpi_device's handle instead of driver's

Signed-off-by: default avatarPatrick Mochel <mochel@linux.intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent a6ba5ebe
...@@ -130,7 +130,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) ...@@ -130,7 +130,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
struct acpi_memory_info *info, *n; struct acpi_memory_info *info, *n;
status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS, status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
acpi_memory_get_resource, mem_device); acpi_memory_get_resource, mem_device);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
list_for_each_entry_safe(info, n, &mem_device->res_list, list) list_for_each_entry_safe(info, n, &mem_device->res_list, list)
...@@ -193,7 +193,7 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device) ...@@ -193,7 +193,7 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
/* Get device present/absent information from the _STA */ /* Get device present/absent information from the _STA */
if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA", if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",
NULL, &current_status))) NULL, &current_status)))
return -ENODEV; return -ENODEV;
/* /*
...@@ -223,7 +223,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) ...@@ -223,7 +223,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
return result; return result;
} }
node = acpi_get_node(mem_device->handle); node = acpi_get_node(mem_device->device->handle);
/* /*
* Tell the VM there is more memory here... * Tell the VM there is more memory here...
* Note: Assume that this function returns zero on success * Note: Assume that this function returns zero on success
...@@ -270,7 +270,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) ...@@ -270,7 +270,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
arg_list.pointer = &arg; arg_list.pointer = &arg;
arg.type = ACPI_TYPE_INTEGER; arg.type = ACPI_TYPE_INTEGER;
arg.integer.value = 1; arg.integer.value = 1;
status = acpi_evaluate_object(mem_device->handle, status = acpi_evaluate_object(mem_device->device->handle,
"_EJ0", &arg_list, NULL); "_EJ0", &arg_list, NULL);
/* Return on _EJ0 failure */ /* Return on _EJ0 failure */
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -279,7 +279,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device) ...@@ -279,7 +279,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
} }
/* Evalute _STA to check if the device is disabled */ /* Evalute _STA to check if the device is disabled */
status = acpi_evaluate_integer(mem_device->handle, "_STA", status = acpi_evaluate_integer(mem_device->device->handle, "_STA",
NULL, &current_status); NULL, &current_status);
if (ACPI_FAILURE(status)) if (ACPI_FAILURE(status))
return -ENODEV; return -ENODEV;
...@@ -399,7 +399,7 @@ static int acpi_memory_device_add(struct acpi_device *device) ...@@ -399,7 +399,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
memset(mem_device, 0, sizeof(struct acpi_memory_device)); memset(mem_device, 0, sizeof(struct acpi_memory_device));
INIT_LIST_HEAD(&mem_device->res_list); INIT_LIST_HEAD(&mem_device->res_list);
mem_device->handle = device->handle; mem_device->device->handle = device->handle;
mem_device->device = device; mem_device->device = device;
sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
......
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