ACPI: scan: Evaluate _DEP before adding the device
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 14 Dec 2020 20:25:23 +0000 (21:25 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 17 Dec 2020 16:50:47 +0000 (17:50 +0100)
commit6fc250887cbe14a350d472516f2e0118240c5d68
treef7877472a8907477a8088214884db1a5c365ee7c
parent91438aebcd56ed3cfa480e4546c7b06e9db3c73c
ACPI: scan: Evaluate _DEP before adding the device

Evaluate _DEP before calling acpi_add_single_object() from
acpi_bus_check_add() and do that only for ACPI_BUS_TYPE_DEVICE
objects.

While at it, rename acpi_device_dep_initialize() to
acpi_scan_check_dep(), fix up a memory allocation statement in
that function, consistently treat memory allocation failures in
there as intermittent errors and make some related janitorial
changes in it.

This change will help to avoid calling acpi_add_single_object() if
there are unmet _DEP dependencies in the future, as that may cause
some control methods, potentially depending on the presence of
operation regions supplied by other devices, to be evaluated
prematurely.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/acpi/scan.c