lkml.org 
[lkml]   [2023]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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


    \
     
     \ /
      Last update: 2023-05-12 13:12    [W:2.296 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site