Re: [PATCH v5 4/4] spi: cs42l43: Add bridged cs35l56 amplifiers

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

 



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





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux