ACPI: Rework acpi_get_child() to be more efficient
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 10 Jan 2013 12:13:49 +0000 (13:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Mar 2013 19:18:14 +0000 (12:18 -0700)
commitb842701f3d800a0fba3cee5ec4163a2356f3aaa5
tree52f6a3b9e68a24cbbb158ca20a16a62d3bf014cf
parentb0925a591f1359e64522a94d5fc56cc1df0abfa0
ACPI: Rework acpi_get_child() to be more efficient

commit 33f767d767e9a684e9cd60704d4c049a2014c8d5 upstream.

Observe that acpi_get_child() doesn't need to use the helper
struct acpi_find_child structure and change it to work without it.
Also, using acpi_get_object_info() to get the output of _ADR for the
given device is overkill, because that function does much more than
just evaluating _ADR (let alone the additional memory allocation
done by it).

Moreover, acpi_get_child() doesn't need to loop any more once it has
found a matching handle, so make it stop in that case.  To prevent
the results from changing, make it use do_acpi_find_child() as
a post-order callback.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/glue.c