On Thu, Apr 11, 2024 at 5:04 PM Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote: > On Thu, Apr 11, 2024 at 12:06 PM Charles Keepax > <ckeepax@xxxxxxxxxxxxxxxxxxxxx> wrote: ... > > + fwnode_for_each_child_node(fwnode, child_fwnode) { > > + acpi_handle handle = ACPI_HANDLE_FWNODE(child_fwnode); > > > + if (!handle) > > + continue; > > This is _almost_ redundant check. handle == NULL is for the global > root object which quite unlikely will have the _ADR method. The > specification is clear about this: "The _ADR object is valid only > within an Augmented Device Descriptor." That said, the check makes > sense against the (very) ill-formed DSDT. > > > + ret = acpi_get_local_address(handle, &function); > > + if (ret || function != func_smart_amp) > > + continue; > > + > > + ext_fwnode = fwnode_get_named_child_node(child_fwnode, > > + "mipi-sdca-function-expansion-subproperties"); > > + if (!ext_fwnode) > > + continue; > > + > > + ret = fwnode_property_read_u32(ext_fwnode, > > + "01fa-cirrus-sidecar-instances", > > + &val); > > + > > + fwnode_handle_put(ext_fwnode); > > + fwnode_handle_put(child_fwnode); And still this leftover... > > + if (!ret) > > + return !!val; -- With Best Regards, Andy Shevchenko