[PATCH v1 4/4] ACPI: glue: Skip devices with no type in acpi_device_notify()

From: Rafael J. Wysocki

Date: Thu Sep 10 2026 - 14:00:15 EST


From: "Rafael J. Wysocki" <rafael.j.wysocki@xxxxxxxxx>

Since all of the users of struct acpi_bus_type use the device type
for matching, devices without a type will not be matched by any of
them, so they can be skipped early in acpi_device_notify().

Update the code accordingly.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
---
drivers/acpi/glue.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 1981ebfb5ce0..c53f3d86254a 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -63,6 +63,9 @@ static struct acpi_device *acpi_companion_lookup(struct device *dev)
{
struct acpi_bus_type *type;

+ if (!dev->type)
+ return NULL;
+
guard(rwsem_read)(&bus_type_sem);

list_for_each_entry(type, &bus_type_list, list) {
--
2.51.0