ACPI: glue: Look for ACPI bus type only if ACPI companion is not known
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 18 Sep 2021 13:02:23 +0000 (15:02 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 Sep 2021 15:01:37 +0000 (17:01 +0200)
commit2ef5236660b677db15527b6d6235af4ce38ea0e3
treebd93836e9c8523226dac046afcd40b3a7ecea6d9
parentc4d19838d8c42828c7e39e4432ea5b33f02dac27
ACPI: glue: Look for ACPI bus type only if ACPI companion is not known

Notice that it is not necessary to look for the "ACPI bus type" of
the device in acpi_device_notify() if the device's ACPI companion
is set upfront, so modify the code to do that lookup only if it is
necessary to find the ACPI companion.

Also notice that if the device's ACPI companion is not set upfront
in acpi_device_notify(), the device cannot be either a PCI one or a
platform one, so check for these bus types only if the device's
ACPI companion is set.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Ferry Toth <fntoth@gmail.com>
drivers/acpi/glue.c