On Thu, Nov 17, 2022 at 01:28:01PM +0000, Niyas Sait wrote: > On 16/11/2022 09:41, Mika Westerberg wrote: > > > > + * pinctrl_acpi_get_pin_groups() - Get ACPI PinGroup Descriptors for the device > > > + * @adev: ACPI device node for retrieving PinGroup descriptors > > > + * @group_desc_list: list head to add PinGroup descriptors > > > + * > > > + * This will parse ACPI PinGroup resources for the given ACPI device > > > + * and will add descriptors to the provided @group_desc_list list > > I would add here what happens to group_desc_list if the function returns > > non-zero. > > > > Also perhaps the API should use an array instead and when NULL is passed > > it returns the size as we do with properties for example. The naged > > list_head pointer looks kind of weird. > > Array would be nice. However I might have to do an additional acpi walk to > find the number of PinGroups to allocate array and another iteration to > populate fields. May be two iterations are not as bad as I thought. Open to > suggestions. I don't think we need to "optimize" anything at this point and this is certainly not a hot path. I suggest to emphasize on the API and think what is easier for the caller (and also if there is simila API already follow that it does).