Message ID | 20240504-pinctrl-cleanup-v2-18-26c5f2dc1181@nxp.com |
---|---|
State | New |
Headers | show |
Series | pinctrl: Use scope based of_node_put() cleanups | expand |
How do you think about to use the summary phrase “Fix reference counting for children in mxs_pinctrl_probe_dt()”? … > of_get_next_child() will increase refcount … the reference counter? > Per current implementation, 'child' will be override by overridden? > for_each_child_of_node(np, child), so use of_get_child_count to avoid > refcount leakage. Another wording suggestion: for_each_child_of_node(np, child). Thus use an of_get_child_count() call to avoid reference counting leakage. Regards, Markus
> Subject: Re: [PATCH v2 18/20] pinctrl: freescale: mxs: Fix refcount of child > > How do you think about to use the summary phrase “Fix reference counting > for children in mxs_pinctrl_probe_dt()”? Thanks for reviewing. I have no plan to rework this series for non-accepted patches. If you have interest and time, feel free to take it. Thanks, Peng. > > > … > > of_get_next_child() will increase refcount … > > the reference counter? > > > > Per current implementation, 'child' will be override by > > overridden? > > > > for_each_child_of_node(np, child), so use of_get_child_count to avoid > > refcount leakage. > > Another wording suggestion: > for_each_child_of_node(np, child). Thus use an of_get_child_count() call > to avoid reference counting leakage. > > > Regards, > Markus
>> How do you think about to use the summary phrase “Fix reference counting >> for children in mxs_pinctrl_probe_dt()”? > > Thanks for reviewing. I have no plan to rework this series for non-accepted patches. … Will development interests grow to take patch review concerns better into account so that commit messages can be improved another bit? Regards, Markus
> Subject: Re: [v2 18/20] pinctrl: freescale: mxs: Fix refcount of child > > >> How do you think about to use the summary phrase “Fix reference > >> counting for children in mxs_pinctrl_probe_dt()”? > > > > Thanks for reviewing. I have no plan to rework this series for non-accepted > patches. > … > > Will development interests grow to take patch review concerns better into > account so that commit messages can be improved another bit? Yes. I had read your comments, since I not plan to redo this series, so not reply every comment. Your suggestions are good, I will improve in my future patch commit messages. Thanks very much! Peng > > Regards, > Markus
diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c index aee70fa55bec..edb242d30609 100644 --- a/drivers/pinctrl/freescale/pinctrl-mxs.c +++ b/drivers/pinctrl/freescale/pinctrl-mxs.c @@ -413,8 +413,8 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev, int ret; u32 val; - child = of_get_next_child(np, NULL); - if (!child) { + val = of_get_child_count(np); + if (val == 0) { dev_err(&pdev->dev, "no group is defined\n"); return -ENOENT; }