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 Tue, Feb 04, 2025 at 10:28:03PM +0530, Sunil V L wrote:
> On Mon, Feb 03, 2025 at 04:41:35PM +0200, Andy Shevchenko wrote:
> > > Ah, interesting. The original change that introduces this 3e3119d3088f ("device
> > > property: Introduce fwnode_property_get_reference_args") hadn't been reviewed
> > > by Mika or me, that's probably why we are not familiar with.
> > > 
> > > Since interface is already established, I would recommend to fix
> > > this as proposed, i.e. with a new API. This is the way to match
> > > how OF seems to be doing.
> > 
> > For the reference see implementation of of_fwnode_get_reference_args()
> > 
> > 	if (nargs_prop)
> > 		ret = of_parse_phandle_with_args(to_of_node(fwnode), prop,
> > 						 nargs_prop, index, &of_args);
> > 	else
> > 		ret = of_parse_phandle_with_fixed_args(to_of_node(fwnode), prop,
> > 						       nargs, index, &of_args);
> > 
> > 
> Thanks!. I can do similar. But the change in
> __acpi_node_get_property_reference() will be still required since that
> is the place where the actual decoding of AML object is done. That would
> be similar to __of_parse_phandle_with_args() as well. Hope that is fine.

You don't need that. Split the core part to local static helper that
takes whatever it needs, but being not visible to anyone outside
drivers/acpi/property.c. And build the current helper and new visible one
on the basis of this split. For better reviewing and maintaining you can
split this approach to two patches: 1) preparatory by splitting a new
local helper; 2) the introduction of a new API.


-- 
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