openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2 07/20] pinctrl: renesas: Use scope based of_node_put() cleanups
       [not found] ` <20240504-pinctrl-cleanup-v2-7-26c5f2dc1181@nxp.com>
@ 2024-05-13 11:59   ` Geert Uytterhoeven
  2024-05-13 12:04     ` Peng Fan
  2024-05-13 20:51     ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2024-05-13 11:59 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: imx, Alexandre Belloni, Peng Fan, Emil Renner Berthing,
	Geert Uytterhoeven, Tony Lindgren, Linus Walleij,
	Alexandre Torgue, Claudiu Beznea, linux-tegra, Thierry Reding,
	Alim Akhtar, Shawn Guo, Sylwester Nawrocki, Hal Feng,
	Fabio Estevam, Ghennadi Procopciuc, Dan Carpenter,
	Heiko Stuebner, linux-samsung-soc, linux-aspeed, Chunyan Zhang,
	openbmc, Krzysztof Kozlowski, Jonathan Hunter, linux-rockchip,
	Ludovic Desroches, Jacky Bai, Joel Stanley, Orson Zhai,
	Patrice Chotard, Chester Lin, Pengutronix Kernel Team,
	Stephen Warren, Sascha Hauer, linux-gpio, soc, Damien Le Moal,
	linux-mediatek, Baolin Wang, Matthias Brugger, linux-arm-kernel,
	AngeloGioacchino Del Regno, Dong Aisheng, Matthias Brugger,
	Dvorkin Dmitry, Sean Wang, linux-stm32, Nicolas Ferre,
	linux-kernel, linux-renesas-soc, Jianlong Huang

Hi Peng,

On Sat, May 4, 2024 at 3:14 PM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Use scope based of_node_put() cleanup to simplify code.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

Thanks for your patch!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c

You missed one trivial conversion, presumably because no error handling
and thus no of_node_put() is involved?

@@ -737,13 +737,12 @@ static int rzn1_pinctrl_parse_groups(struct
device_node *np,

 static int rzn1_pinctrl_count_function_groups(struct device_node *np)
 {
-       struct device_node *child;
        int count = 0;

        if (of_property_count_u32_elems(np, RZN1_PINS_PROP) > 0)
                count++;

-       for_each_child_of_node(np, child) {
+       for_each_child_of_node_scoped(np, child) {
                if (of_property_count_u32_elems(child, RZN1_PINS_PROP) > 0)
                        count++;
        }

If you prefer not to include this, I will send a small patch myself later.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH v2 07/20] pinctrl: renesas: Use scope based of_node_put() cleanups
  2024-05-13 11:59   ` [PATCH v2 07/20] pinctrl: renesas: Use scope based of_node_put() cleanups Geert Uytterhoeven
@ 2024-05-13 12:04     ` Peng Fan
  2024-05-13 20:51     ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Peng Fan @ 2024-05-13 12:04 UTC (permalink / raw)
  To: Geert Uytterhoeven, Peng Fan (OSS)
  Cc: imx, Alexandre Belloni, Emil Renner Berthing, Geert Uytterhoeven,
	Tony Lindgren, Linus Walleij, Alexandre Torgue, Claudiu Beznea,
	linux-tegra, Thierry Reding, Alim Akhtar, Shawn Guo,
	Sylwester Nawrocki, Hal Feng, Fabio Estevam,
	Ghennadi Procopciuc (OSS),
	Dan Carpenter, Heiko Stuebner, linux-samsung-soc, linux-aspeed,
	Chunyan Zhang, openbmc@lists.ozlabs.org

> Subject: Re: [PATCH v2 07/20] pinctrl: renesas: Use scope based
> of_node_put() cleanups
> 
> Hi Peng,
> 
> On Sat, May 4, 2024 at 3:14 PM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Use scope based of_node_put() cleanup to simplify code.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> 
> Thanks for your patch!
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> > --- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
> > +++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
> 
> You missed one trivial conversion, presumably because no error handling and
> thus no of_node_put() is involved?

You are right.

> 
> @@ -737,13 +737,12 @@ static int rzn1_pinctrl_parse_groups(struct
> device_node *np,
> 
>  static int rzn1_pinctrl_count_function_groups(struct device_node *np)  {
> -       struct device_node *child;
>         int count = 0;
> 
>         if (of_property_count_u32_elems(np, RZN1_PINS_PROP) > 0)
>                 count++;
> 
> -       for_each_child_of_node(np, child) {
> +       for_each_child_of_node_scoped(np, child) {
>                 if (of_property_count_u32_elems(child, RZN1_PINS_PROP) > 0)
>                         count++;
>         }
> 
> If you prefer not to include this, I will send a small patch myself later.

I would not add it.
If no major comments in this patchset, I will not do a v3. So, please do that
with your follow up patch.

Thanks,
Peng.

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-
> m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 07/20] pinctrl: renesas: Use scope based of_node_put() cleanups
  2024-05-13 11:59   ` [PATCH v2 07/20] pinctrl: renesas: Use scope based of_node_put() cleanups Geert Uytterhoeven
  2024-05-13 12:04     ` Peng Fan
@ 2024-05-13 20:51     ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2024-05-13 20:51 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: imx, Alexandre Belloni, Peng Fan, Heiko Stuebner,
	Geert Uytterhoeven, Tony Lindgren, Alexandre Torgue,
	Claudiu Beznea, linux-tegra, Thierry Reding, Alim Akhtar,
	Shawn Guo, Sylwester Nawrocki, Hal Feng, Fabio Estevam,
	Ghennadi Procopciuc, Dan Carpenter, Emil Renner Berthing,
	linux-samsung-soc, linux-aspeed, Chunyan Zhang, openbmc,
	Krzysztof Kozlowski, Jonathan Hunter, linux-rockchip,
	Ludovic Desroches

On Mon, May 13, 2024 at 1:59 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Sat, May 4, 2024 at 3:14 PM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Use scope based of_node_put() cleanup to simplify code.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
>
> Thanks for your patch!
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Does this go into the Renesas patch stack?

I think the patch stands fine without the rest of the series.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-13 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240504-pinctrl-cleanup-v2-0-26c5f2dc1181@nxp.com>
     [not found] ` <20240504-pinctrl-cleanup-v2-7-26c5f2dc1181@nxp.com>
2024-05-13 11:59   ` [PATCH v2 07/20] pinctrl: renesas: Use scope based of_node_put() cleanups Geert Uytterhoeven
2024-05-13 12:04     ` Peng Fan
2024-05-13 20:51     ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).