[PATCH v7 15/24] ACPI: property: Add support for cells property

Andy Shevchenko andriy.shevchenko at linux.intel.com
Wed Jul 2 04:44:21 PDT 2025


On Wed, Jul 02, 2025 at 10:43:36AM +0530, Anup Patel wrote:
> From: Sunil V L <sunilvl at ventanamicro.com>
> 
> Currently, ACPI doesn't support cells property when
> fwnode_property_get_reference_args() is called. ACPI always expects
> the number of arguments to be passed. However, the above mentioned
> call being a common interface for OF and ACPI, it is better to have
> single calling convention which works for both. Hence, add support
> for cells property on the reference device to get the number of
> arguments dynamically.

You can use Elvis to shorten lines, but in my opinion this is okay change
overall. FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>



>  
> +			nargs_count = acpi_fwnode_get_args_count(device, nargs_prop);
>  			element++;
> -


u probably want to leave this blank line and rather move the new code here

			element++;

			nargs_count = acpi_fwnode_get_args_count(device, nargs_prop);

>  			ret = acpi_get_ref_args(idx == index ? args : NULL,
>  						acpi_fwnode_handle(device),
> -						&element, end, args_count);
> +						&element, end,
> +						nargs_count ? nargs_count : args_count);

						&element, end, nargs_count ?: args_count);

>  			if (ret < 0)
>  				return ret;

...

> +			device = to_acpi_device_node(ref_fwnode);
> +			nargs_count = acpi_fwnode_get_args_count(device, nargs_prop);
>  			element++;
> -
>  			ret = acpi_get_ref_args(idx == index ? args : NULL,
>  						ref_fwnode, &element, end,
> -						args_count);
> +						nargs_count ? nargs_count : args_count);
>  			if (ret < 0)
>  				return ret;

As per above.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-riscv mailing list