Linux USB
 help / color / mirror / Atom feed
* [PATCH v1 0/3] ACPI: glue: Rework ACPI companion lookup related to device type
@ 2026-11-04 20:09 Rafael J. Wysocki
  2026-11-04 20:11 ` [PATCH v1 1/3] ACPI: glue: Rename struct acpi_bus_type to acpi_dev_type Rafael J. Wysocki
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2026-11-04 20:09 UTC (permalink / raw)
  To: Linux ACPI
  Cc: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Andreas Noever, Mika Westerberg, Yehezkel Bernat,
	Greg Kroah-Hartman, dri-devel, linux-usb, Andy Shevchenko

Hi All,

The ACPI "glue" code is responsible for binding Linux devices (like platform
devices for one example) to their ACPI companions (represented by struct
acpi_device objects).  This is done by acpi_device_notify() when the given
device is registered.

If the device's ACPI companion is set already at that point, the binding
simply adds the device to the list of "physical nodes" associated with its
ACPI companion.  That's the case for PCI devices and platform devices, for
example.  However, there are cases in which the ACPI companion is not set
upfront and it needs to be looked up via "lookup helpers" registered by
the subsystems the devices in question belong to.  This series changes
the "lookup helpers" representation and handling.

Before the changes, the "lookup helpers" are represented by struct
acpi_bus_type objects which is doubly confusing because they have nothing
to do with bus types and because the "acpi_bus_type" name is also used
elsewhere.  Patch [1/3] renames struct acpi_bus_type to struct acpi_dev_type
because all of the existing "lookup helpers" operate on device types.

Next, the registration and unregistration functions for "lookup helpers"
are defined to return an int, but all of their existing users effectively
discard their return values (they are discarded right away or passed up the
call chain and then discarded).  Patch [2/3] changes the return type of
those functions to void.

Finally, since all of the existing "lookup helpers" match dev->type to
a certain device type, they can be rearranged to point to the device
types in question and provide a .find_companion() callback, and an
additional .setup() callback in one case.  This is done by patch [3/3]
and allows all of the affected code to be simplified quite a bit.

Thanks!






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-04 20:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 20:09 [PATCH v1 0/3] ACPI: glue: Rework ACPI companion lookup related to device type Rafael J. Wysocki
2026-11-04 20:11 ` [PATCH v1 1/3] ACPI: glue: Rename struct acpi_bus_type to acpi_dev_type Rafael J. Wysocki
2026-11-04 20:18   ` sashiko-bot
2026-11-04 20:13 ` [PATCH v1 2/3] ACPI: glue: Change (un)register_acpi_dev_type() to void functions Rafael J. Wysocki
2026-11-04 20:18   ` sashiko-bot
2026-11-04 20:14 ` [PATCH v1 3/3] ACPI: glue: Simplify struct acpi_dev_type and its usage Rafael J. Wysocki
2026-11-04 20:20   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox