Skip to content

Commit

Permalink
ACPI: dock: check if parent is on dock
Browse files Browse the repository at this point in the history
When determining if a device is on a dock station, we should
check the parent of the device as well.

Signed-off-by:  Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Kristen Carlson Accardi authored and Len Brown committed Feb 3, 2007
1 parent e47fddf commit fe9a2f7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions drivers/acpi/dock.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,20 +615,28 @@ static acpi_status
find_dock_devices(acpi_handle handle, u32 lvl, void *context, void **rv)
{
acpi_status status;
acpi_handle tmp;
acpi_handle tmp, parent;
struct dock_station *ds = context;
struct dock_dependent_device *dd;

status = acpi_bus_get_ejd(handle, &tmp);
if (ACPI_FAILURE(status))
return AE_OK;
if (ACPI_FAILURE(status)) {
/* try the parent device as well */
status = acpi_get_parent(handle, &parent);
if (ACPI_FAILURE(status))
goto fdd_out;
/* see if parent is dependent on dock */
status = acpi_bus_get_ejd(parent, &tmp);
if (ACPI_FAILURE(status))
goto fdd_out;
}

if (tmp == ds->handle) {
dd = alloc_dock_dependent_device(handle);
if (dd)
add_dock_dependent_device(ds, dd);
}

fdd_out:
return AE_OK;
}

Expand Down

0 comments on commit fe9a2f7

Please sign in to comment.