Re: [RFC PATCH v2 12/17] ACPI: property: Add support for nargs_prop in acpi_fwnode_get_reference_args()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 03, 2025 at 02:19:01PM +0530, Anup Patel wrote:
> From: Sunil V L <sunilvl@xxxxxxxxxxxxxxxx>
> 
> fwnode_get_reference_args() which is common for both DT and ACPI passes
> a property name like #mbox-cells which needs to be fetched from the
> reference node to determine the number of arguments needed for the
> property. However, the ACPI version of this function doesn't support
> this and simply ignores the parameter passed from the wrapper function.
> Add support for dynamically finding number of arguments by reading the
> nargs property value. Update the callers to pass extra parameter.

I don't like this (implementation).

It seems that we basically have two parameters which values are duplicating
each other. This is error prone API and confusing in the cases when both are
defined. If you want property, add a new API that takes const char *nargs
and relies on the property be present.

Your patch becomes much simpler, and solution is robust against potential
confusion on how to treat the corner cases.

Note, Rafael might have different opinion and his has the last word. But
here just my view on the implementation details.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux