]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ACPI: property: Refactor acpi_fwnode_get_reference_args() to support nargs_prop
authorSunil V L <sunilvl@ventanamicro.com>
Mon, 18 Aug 2025 04:09:10 +0000 (09:39 +0530)
committerPaul Walmsley <pjw@kernel.org>
Thu, 25 Sep 2025 21:28:12 +0000 (15:28 -0600)
commite121be784d35e2950652b46258a87381e00270ab
treecf9ffb1c06307913dc45a400a5bb36a2f2808510
parentaa43953e862c031ff66e44353c88beb7a449e80d
ACPI: property: Refactor acpi_fwnode_get_reference_args() to support nargs_prop

Currently, acpi_fwnode_get_reference_args() delegates to the internal
function __acpi_node_get_property_reference() to retrieve property
references. However, this function does not handle the nargs_prop (cells
property) parameter, and instead expects the number of arguments (nargs)
to be known or hardcoded.

As a result, when fwnode_property_get_reference_args() is used with a
valid nargs_prop, the ACPI backend ignores it, whereas the Device Tree
(DT) backend uses the #*-cells property from the reference node to
determine the number of arguments dynamically.

To support the nargs_prop in ACPI, refactor the code as follows:

- Move the implementation from __acpi_node_get_property_reference()
  into acpi_fwnode_get_reference_args().

- Update __acpi_node_get_property_reference() to call the (now updated)
  acpi_fwnode_get_reference_args() passing NULL as nargs_prop to keep
  the behavior of __acpi_node_get_property_reference() intact.

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Link: https://lore.kernel.org/r/20250818040920.272664-15-apatel@ventanamicro.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
drivers/acpi/property.c