ACPI: utils: Document for_each_acpi_dev_match() macro
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Mon, 12 Apr 2021 23:20:51 +0000 (02:20 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 13 Apr 2021 13:48:02 +0000 (15:48 +0200)
commit81eeb2f57782d0dff15db97665599121e289b614
tree14f2f2308b8d96135c315062968978e4b9bb2c7c
parentd434405aaab7d0ebc516b68a8fc4100922d7f5ef
ACPI: utils: Document for_each_acpi_dev_match() macro

The macro requires to call acpi_dev_put() on each iteration.
Due to this it doesn't tolerate sudden disappearence of the devices.

Document all these nuances to prevent users blindly call it without
understanding the possible issues.

While at it, add the note to the acpi_dev_get_next_match_dev() and
advertise acpi_dev_put() instead of put_device() in the whole family
of the helper functions.

Fixes: bf263f64e804 ("media: ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro")
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/utils.c
include/acpi/acpi_bus.h