All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Rob Herring <robh@kernel.org>
Cc: Sean Wang <sean.wang@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	 Tony Lindgren <tony@atomide.com>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	 Geert Uytterhoeven <geert+renesas@glider.be>,
	Chen-Yu Tsai <wens@csie.org>,
	 Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	 Matthias Brugger <matthias.bgg@gmail.com>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	devicetree@vger.kernel.org,  linux-mediatek@lists.infradead.org,
	linux-gpio@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-omap@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	 linux-renesas-soc@vger.kernel.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH] pinctrl: Use of_property_present() for testing DT property presence
Date: Mon, 13 Mar 2023 10:00:48 +0100	[thread overview]
Message-ID: <CAMuHMdUaeyHs9fQxS+16F62uHaifJYMXKJpL2-xi-SL5HCrTHQ@mail.gmail.com> (raw)
In-Reply-To: <20230310144721.1544669-1-robh@kernel.org>

Hi Rob,

On Fri, Mar 10, 2023 at 3:56 PM Rob Herring <robh@kernel.org> wrote:
> It is preferred to use typed property access functions (i.e.
> of_property_read_<type> functions) rather than low-level
> of_get_property/of_find_property functions for reading properties. As
> part of this, convert of_get_property/of_find_property calls to the
> recently added of_property_present() helper when we just want to test
> for presence of a property and nothing more.
>
> Signed-off-by: Rob Herring <robh@kernel.org>

Thanks for your patch!

> --- a/drivers/pinctrl/renesas/pinctrl.c
> +++ b/drivers/pinctrl/renesas/pinctrl.c
> @@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
>          * inside a subnode nor across subnodes.
>          */
>         if (!pmx->func_prop_name) {
> -               if (of_find_property(np, "groups", NULL) ||
> -                   of_find_property(np, "pins", NULL)) {
> +               if (of_property_present(np, "groups")||
> +                   of_property_present(np, "pins")) {
>                         pmx->func_prop_name = "function";
>                         pmx->groups_prop_name = "groups";
>                         pmx->pins_prop_name = "pins";

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

This check is used to auto-detect if the standard property names
should be used, or the "renesas,"-prefixed ones.
As the last users of the latter were removed from DTS in v4.10,
perhaps I should just remove these checks instead?

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

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Rob Herring <robh@kernel.org>
Cc: Sean Wang <sean.wang@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	 Tony Lindgren <tony@atomide.com>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	 Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	 Geert Uytterhoeven <geert+renesas@glider.be>,
	Chen-Yu Tsai <wens@csie.org>,
	 Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	 Matthias Brugger <matthias.bgg@gmail.com>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	devicetree@vger.kernel.org,  linux-mediatek@lists.infradead.org,
	linux-gpio@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-omap@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	 linux-renesas-soc@vger.kernel.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH] pinctrl: Use of_property_present() for testing DT property presence
Date: Mon, 13 Mar 2023 10:00:48 +0100	[thread overview]
Message-ID: <CAMuHMdUaeyHs9fQxS+16F62uHaifJYMXKJpL2-xi-SL5HCrTHQ@mail.gmail.com> (raw)
In-Reply-To: <20230310144721.1544669-1-robh@kernel.org>

Hi Rob,

On Fri, Mar 10, 2023 at 3:56 PM Rob Herring <robh@kernel.org> wrote:
> It is preferred to use typed property access functions (i.e.
> of_property_read_<type> functions) rather than low-level
> of_get_property/of_find_property functions for reading properties. As
> part of this, convert of_get_property/of_find_property calls to the
> recently added of_property_present() helper when we just want to test
> for presence of a property and nothing more.
>
> Signed-off-by: Rob Herring <robh@kernel.org>

Thanks for your patch!

> --- a/drivers/pinctrl/renesas/pinctrl.c
> +++ b/drivers/pinctrl/renesas/pinctrl.c
> @@ -125,8 +125,8 @@ static int sh_pfc_dt_subnode_to_map(struct pinctrl_dev *pctldev,
>          * inside a subnode nor across subnodes.
>          */
>         if (!pmx->func_prop_name) {
> -               if (of_find_property(np, "groups", NULL) ||
> -                   of_find_property(np, "pins", NULL)) {
> +               if (of_property_present(np, "groups")||
> +                   of_property_present(np, "pins")) {
>                         pmx->func_prop_name = "function";
>                         pmx->groups_prop_name = "groups";
>                         pmx->pins_prop_name = "pins";

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

This check is used to auto-detect if the standard property names
should be used, or the "renesas,"-prefixed ones.
As the last users of the latter were removed from DTS in v4.10,
perhaps I should just remove these checks instead?

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-03-13  9:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 14:47 [PATCH] pinctrl: Use of_property_present() for testing DT property presence Rob Herring
2023-03-10 14:47 ` Rob Herring
2023-03-13  8:44 ` AngeloGioacchino Del Regno
2023-03-13  8:44   ` AngeloGioacchino Del Regno
2023-03-13  9:00 ` Geert Uytterhoeven [this message]
2023-03-13  9:00   ` Geert Uytterhoeven
2023-03-13 11:00   ` Geert Uytterhoeven
2023-03-13 11:00     ` Geert Uytterhoeven
2023-03-19 20:55     ` Linus Walleij
2023-03-19 20:55       ` Linus Walleij
2023-03-20  8:01       ` Geert Uytterhoeven
2023-03-20  8:01         ` Geert Uytterhoeven
2023-03-20 18:17       ` Rob Herring
2023-03-20 18:17         ` Rob Herring
2023-03-23  8:29         ` Linus Walleij
2023-03-23  8:29           ` Linus Walleij
2023-03-13 10:17 ` Andre Przywara
2023-03-13 10:17   ` Andre Przywara
2023-03-14 20:01 ` Jernej Škrabec
2023-03-14 20:01   ` Jernej Škrabec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdUaeyHs9fQxS+16F62uHaifJYMXKJpL2-xi-SL5HCrTHQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=haojian.zhuang@linaro.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=matthias.bgg@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.org \
    --cc=sean.wang@kernel.org \
    --cc=tony@atomide.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.