diff options
Diffstat (limited to 'drivers/acpi/dock.c')
-rw-r--r-- | drivers/acpi/dock.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index f32bd47b35e0..9e31b2bd93d3 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -310,8 +310,6 @@ static int dock_present(struct dock_station *ds) | |||
310 | static struct acpi_device * dock_create_acpi_device(acpi_handle handle) | 310 | static struct acpi_device * dock_create_acpi_device(acpi_handle handle) |
311 | { | 311 | { |
312 | struct acpi_device *device; | 312 | struct acpi_device *device; |
313 | struct acpi_device *parent_device; | ||
314 | acpi_handle parent; | ||
315 | int ret; | 313 | int ret; |
316 | 314 | ||
317 | if (acpi_bus_get_device(handle, &device)) { | 315 | if (acpi_bus_get_device(handle, &device)) { |
@@ -319,16 +317,11 @@ static struct acpi_device * dock_create_acpi_device(acpi_handle handle) | |||
319 | * no device created for this object, | 317 | * no device created for this object, |
320 | * so we should create one. | 318 | * so we should create one. |
321 | */ | 319 | */ |
322 | acpi_get_parent(handle, &parent); | 320 | ret = acpi_bus_add(handle); |
323 | if (acpi_bus_get_device(parent, &parent_device)) | 321 | if (ret) |
324 | parent_device = NULL; | ||
325 | |||
326 | ret = acpi_bus_add(&device, parent_device, handle, | ||
327 | ACPI_BUS_TYPE_DEVICE); | ||
328 | if (ret) { | ||
329 | pr_debug("error adding bus, %x\n", -ret); | 322 | pr_debug("error adding bus, %x\n", -ret); |
330 | return NULL; | 323 | |
331 | } | 324 | acpi_bus_get_device(handle, &device); |
332 | } | 325 | } |
333 | return device; | 326 | return device; |
334 | } | 327 | } |