Re: [PATCHv2 3/6] hwmon: (socfpga) Add hardware monitoring support on SoCFPGA platforms

From: Andy Shevchenko
Date: Sat May 27 2023 - 04:28:43 EST


On Thu, May 25, 2023 at 04:20:12PM -0500, Dinh Nguyen wrote:
> On 5/9/2023 1:57 AM, Krzysztof Kozlowski wrote:
> > On 08/05/2023 23:28, dinh.nguyen@xxxxxxxxxxxxxxx wrote:

> > > + for_each_child_of_node(child, grandchild) {
> > > + ret = of_property_read_u32(grandchild, "reg", &val);
> > > + if (ret)
> > > + return dev_err_probe(dev, ret, "missing reg property of %pOF\n",
> > > + grandchild);
> > Where do you drop child reference?
>
> Not sure what you mean here? Can you clarify?

for_each_child_of_node() bumps a reference of the current (iterator) node, when
the loop is interrupted it's a user (of for_each macro) responsibility to drop
it.

--
With Best Regards,
Andy Shevchenko