From 3b74863df5d46f794052b5ee010cfc8fd66819dd Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Fri, 19 May 2006 16:54:38 -0400 Subject: ACPI: acpi_memhotplug: add struct acpi_device to struct acpi_memory_device. Signed-off-by: Patrick Mochel Signed-off-by: Len Brown --- drivers/acpi/acpi_memhotplug.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/acpi/acpi_memhotplug.c') diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 6f5e395c78a..c5622244a21 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -81,6 +81,7 @@ struct acpi_memory_info { struct acpi_memory_device { acpi_handle handle; + struct acpi_device * device; unsigned int state; /* State of the memory device */ struct list_head res_list; }; @@ -399,6 +400,7 @@ static int acpi_memory_device_add(struct acpi_device *device) INIT_LIST_HEAD(&mem_device->res_list); mem_device->handle = device->handle; + mem_device->device = device; sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); acpi_driver_data(device) = mem_device; -- cgit v1.2.3 From b863278523f7adbacb9e34133f4b6397cdab9977 Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Fri, 19 May 2006 16:54:41 -0400 Subject: ACPI: acpi_memhotplug: Use acpi_device's handle instead of driver's Signed-off-by: Patrick Mochel Signed-off-by: Len Brown --- drivers/acpi/acpi_memhotplug.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/acpi/acpi_memhotplug.c') diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index c5622244a21..a8860de2fef 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -130,7 +130,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) 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); if (ACPI_FAILURE(status)) { 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) /* 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, ¤t_status))) return -ENODEV; /* @@ -223,7 +223,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) 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... * 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) arg_list.pointer = &arg; arg.type = ACPI_TYPE_INTEGER; arg.integer.value = 1; - status = acpi_evaluate_object(mem_device->handle, + status = acpi_evaluate_object(mem_device->device->handle, "_EJ0", &arg_list, NULL); /* Return on _EJ0 failure */ if (ACPI_FAILURE(status)) { @@ -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 */ - status = acpi_evaluate_integer(mem_device->handle, "_STA", + status = acpi_evaluate_integer(mem_device->device->handle, "_STA", NULL, ¤t_status); if (ACPI_FAILURE(status)) return -ENODEV; @@ -399,7 +399,7 @@ static int acpi_memory_device_add(struct acpi_device *device) memset(mem_device, 0, sizeof(struct acpi_memory_device)); INIT_LIST_HEAD(&mem_device->res_list); - mem_device->handle = device->handle; + mem_device->device->handle = device->handle; mem_device->device = device; sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); -- cgit v1.2.3 From 9453ece92688fedd7755d2ea54b2efe88822a91b Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Fri, 19 May 2006 16:54:49 -0400 Subject: ACPI: acpi_memhotplug: Remove unneeded acpi_handle from driver. Signed-off-by: Patrick Mochel Signed-off-by: Len Brown --- drivers/acpi/acpi_memhotplug.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/acpi/acpi_memhotplug.c') diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index a8860de2fef..97863143d21 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -80,7 +80,6 @@ struct acpi_memory_info { }; struct acpi_memory_device { - acpi_handle handle; struct acpi_device * device; unsigned int state; /* State of the memory device */ struct list_head res_list; @@ -399,7 +398,6 @@ static int acpi_memory_device_add(struct acpi_device *device) memset(mem_device, 0, sizeof(struct acpi_memory_device)); INIT_LIST_HEAD(&mem_device->res_list); - mem_device->device->handle = device->handle; mem_device->device = device; sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME); sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS); -- cgit v1.2.3