aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_memhotplug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpi_memhotplug.c')
-rw-r--r--drivers/acpi/acpi_memhotplug.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index eb30e5ab4cab..d0a7da704d49 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -157,34 +157,17 @@ static int
157acpi_memory_get_device(acpi_handle handle, 157acpi_memory_get_device(acpi_handle handle,
158 struct acpi_memory_device **mem_device) 158 struct acpi_memory_device **mem_device)
159{ 159{
160 acpi_status status;
161 acpi_handle phandle;
162 struct acpi_device *device = NULL; 160 struct acpi_device *device = NULL;
163 struct acpi_device *pdevice = NULL;
164 int result; 161 int result;
165 162
166
167 if (!acpi_bus_get_device(handle, &device) && device) 163 if (!acpi_bus_get_device(handle, &device) && device)
168 goto end; 164 goto end;
169 165
170 status = acpi_get_parent(handle, &phandle);
171 if (ACPI_FAILURE(status)) {
172 ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
173 return -EINVAL;
174 }
175
176 /* Get the parent device */
177 result = acpi_bus_get_device(phandle, &pdevice);
178 if (result) {
179 acpi_handle_warn(phandle, "Cannot get acpi bus device\n");
180 return -EINVAL;
181 }
182
183 /* 166 /*
184 * Now add the notified device. This creates the acpi_device 167 * Now add the notified device. This creates the acpi_device
185 * and invokes .add function 168 * and invokes .add function
186 */ 169 */
187 result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE); 170 result = acpi_bus_add(handle, &device);
188 if (result) { 171 if (result) {
189 acpi_handle_warn(handle, "Cannot add acpi bus\n"); 172 acpi_handle_warn(handle, "Cannot add acpi bus\n");
190 return -EINVAL; 173 return -EINVAL;