Thread (10 messages) 10 messages, 6 authors, 2023-03-23

Re: [PATCH] pinctrl: Use of_property_present() for testing DT property presence

From: Rob Herring <robh@kernel.org>
Date: 2023-03-20 18:26:14
Also in: linux-devicetree, linux-gpio, linux-mediatek, linux-omap, linux-renesas-soc, linux-sunxi, lkml

On Sun, Mar 19, 2023 at 3:55 PM Linus Walleij [off-list ref] wrote:
On Mon, Mar 13, 2023 at 12:00 PM Geert Uytterhoeven
[off-list ref] wrote:
quoted
On Mon, Mar 13, 2023 at 10:00 AM Geert Uytterhoeven
[off-list ref] wrote:
quoted
On Fri, Mar 10, 2023 at 3:56 PM Rob Herring [off-list ref] wrote:
quoted
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!
quoted
--- 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?
Sent a patch just doing that, so you can drop this chunk.
https://lore.kernel.org/linux-renesas-soc/ff9c14781110bbf19b56b45dd1f01e6da90319ad.1678704441.git.geert+renesas@glider.be (local)
So I need a new version of this patch before I can apply it
I guess, or there will be conflict with Reseas stuff?
Can you just drop drivers/pinctrl/renesas/pinctrl.c from this patch?

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help