Messages in this thread | | | Date | Fri, 12 May 2023 14:11:45 +0300 | From | Andy Shevchenko <> | Subject | Re: [PATCHv2 3/6] hwmon: (socfpga) Add hardware monitoring support on SoCFPGA platforms |
| |
On Tue, May 09, 2023 at 08:57:26AM +0200, Krzysztof Kozlowski wrote: > On 08/05/2023 23:28, dinh.nguyen@linux.intel.com wrote:
...
> > + struct device_node *child; > > + int ret = 0; > > + > > + for_each_child_of_node(np, child) { > > + ret = socfpga_probe_child_from_dt(dev, child, priv); > > + if (ret) > > + break; > > + } > > + of_node_put(child); > > Hm, and if the loop does not break, is this still correct?
Yes, since NULL is okay for of_node_put(). However the explicit call inside the if (ret) can be more obvious on what's going on.
> > + return ret;
-- With Best Regards, Andy Shevchenko
| |