* [PATCH] clk: Use of_node_name_eq for node name comparisons
@ 2018-12-05 19:50 Rob Herring
2018-12-05 20:43 ` Stephen Boyd
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Rob Herring @ 2018-12-05 19:50 UTC (permalink / raw)
To: devicetree, linux-kernel
Cc: Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Tero Kristo,
Ulf Hansson, linux-renesas-soc, linux-clk, linux-omap,
linux-arm-kernel
Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.
For instances using of_node_cmp, this has the side effect of now using
case sensitive comparisons. This should not matter for any FDT based
system which all of these are.
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Tero Kristo <t-kristo@ti.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/clk/renesas/clk-mstp.c | 2 +-
drivers/clk/ti/clkctrl.c | 2 +-
drivers/clk/ti/dpll.c | 2 +-
drivers/clk/ux500/u8500_of_clk.c | 10 +++++-----
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
index 1c1768c2cc82..765175d1148a 100644
--- a/drivers/clk/renesas/clk-mstp.c
+++ b/drivers/clk/renesas/clk-mstp.c
@@ -280,7 +280,7 @@ int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
goto found;
/* BSC on r8a73a4/sh73a0 uses zb_clk instead of an mstp clock */
- if (!strcmp(clkspec.np->name, "zb_clk"))
+ if (of_node_name_eq(clkspec.np, "zb_clk"))
goto found;
of_node_put(clkspec.np);
diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
index 469f560ae1cf..40630eb950fc 100644
--- a/drivers/clk/ti/clkctrl.c
+++ b/drivers/clk/ti/clkctrl.c
@@ -448,7 +448,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
char *c;
if (!(ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT) &&
- !strcmp(node->name, "clk"))
+ of_node_name_eq(node, "clk"))
ti_clk_features.flags |= TI_CLK_CLKCTRL_COMPAT;
addrp = of_get_address(node, 0, NULL, NULL);
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index 92e28af7afba..6c3329bc116f 100644
--- a/drivers/clk/ti/dpll.c
+++ b/drivers/clk/ti/dpll.c
@@ -410,7 +410,7 @@ static void __init of_ti_omap3_dpll_setup(struct device_node *node)
if ((of_machine_is_compatible("ti,omap3630") ||
of_machine_is_compatible("ti,omap36xx")) &&
- !strcmp(node->name, "dpll5_ck"))
+ of_node_name_eq(node, "dpll5_ck"))
of_ti_dpll_setup(node, &omap3_dpll5_ck_ops, &dd);
else
of_ti_dpll_setup(node, &omap3_dpll_ck_ops, &dd);
diff --git a/drivers/clk/ux500/u8500_of_clk.c b/drivers/clk/ux500/u8500_of_clk.c
index d5888591e1a9..18a3c4522831 100644
--- a/drivers/clk/ux500/u8500_of_clk.c
+++ b/drivers/clk/ux500/u8500_of_clk.c
@@ -545,21 +545,21 @@ static void u8500_clk_init(struct device_node *np)
for_each_child_of_node(np, child) {
static struct clk_onecell_data clk_data;
- if (!of_node_cmp(child->name, "prcmu-clock")) {
+ if (of_node_name_eq(child, "prcmu-clock")) {
clk_data.clks = prcmu_clk;
clk_data.clk_num = ARRAY_SIZE(prcmu_clk);
of_clk_add_provider(child, of_clk_src_onecell_get, &clk_data);
}
- if (!of_node_cmp(child->name, "prcc-periph-clock"))
+ if (of_node_name_eq(child, "prcc-periph-clock"))
of_clk_add_provider(child, ux500_twocell_get, prcc_pclk);
- if (!of_node_cmp(child->name, "prcc-kernel-clock"))
+ if (of_node_name_eq(child, "prcc-kernel-clock"))
of_clk_add_provider(child, ux500_twocell_get, prcc_kclk);
- if (!of_node_cmp(child->name, "rtc32k-clock"))
+ if (of_node_name_eq(child, "rtc32k-clock"))
of_clk_add_provider(child, of_clk_src_simple_get, rtc_clk);
- if (!of_node_cmp(child->name, "smp-twd-clock"))
+ if (of_node_name_eq(child, "smp-twd-clock"))
of_clk_add_provider(child, of_clk_src_simple_get, twd_clk);
}
}
--
2.19.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] clk: Use of_node_name_eq for node name comparisons
2018-12-05 19:50 [PATCH] clk: Use of_node_name_eq for node name comparisons Rob Herring
@ 2018-12-05 20:43 ` Stephen Boyd
2018-12-05 21:16 ` Geert Uytterhoeven
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2018-12-05 20:43 UTC (permalink / raw)
To: Rob Herring, devicetree, linux-kernel
Cc: Geert Uytterhoeven, Michael Turquette, Tero Kristo, Ulf Hansson,
linux-renesas-soc, linux-clk, linux-omap, linux-arm-kernel
Quoting Rob Herring (2018-12-05 11:50:21)
> Convert string compares of DT node names to use of_node_name_eq helper
> instead. This removes direct access to the node name pointer.
>
> For instances using of_node_cmp, this has the side effect of now using
> case sensitive comparisons. This should not matter for any FDT based
> system which all of these are.
>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: Tero Kristo <t-kristo@ti.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
Looks ok at a glance. I'll wait for some people to ack or test it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clk: Use of_node_name_eq for node name comparisons
2018-12-05 19:50 [PATCH] clk: Use of_node_name_eq for node name comparisons Rob Herring
2018-12-05 20:43 ` Stephen Boyd
@ 2018-12-05 21:16 ` Geert Uytterhoeven
2018-12-11 9:42 ` Ulf Hansson
2018-12-14 21:53 ` Stephen Boyd
3 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2018-12-05 21:16 UTC (permalink / raw)
To: Rob Herring
Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Linux Kernel Mailing List, Geert Uytterhoeven, Michael Turquette,
Stephen Boyd, Tero Kristo, Ulf Hansson, Linux-Renesas, linux-clk,
open list:TI ETHERNET SWITCH DRIVER (CPSW),
Linux ARM
On Wed, Dec 5, 2018 at 8:50 PM Rob Herring <robh@kernel.org> wrote:
> Convert string compares of DT node names to use of_node_name_eq helper
> instead. This removes direct access to the node name pointer.
>
> For instances using of_node_cmp, this has the side effect of now using
> case sensitive comparisons. This should not matter for any FDT based
> system which all of these are.
>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: Tero Kristo <t-kristo@ti.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> drivers/clk/renesas/clk-mstp.c | 2 +-
> drivers/clk/ti/clkctrl.c | 2 +-
> drivers/clk/ti/dpll.c | 2 +-
> drivers/clk/ux500/u8500_of_clk.c | 10 +++++-----
> 4 files changed, 8 insertions(+), 8 deletions(-)
For drivers/clk/renesas/clk-mstp.c :
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
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] 5+ messages in thread
* Re: [PATCH] clk: Use of_node_name_eq for node name comparisons
2018-12-05 19:50 [PATCH] clk: Use of_node_name_eq for node name comparisons Rob Herring
2018-12-05 20:43 ` Stephen Boyd
2018-12-05 21:16 ` Geert Uytterhoeven
@ 2018-12-11 9:42 ` Ulf Hansson
2018-12-14 21:53 ` Stephen Boyd
3 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2018-12-11 9:42 UTC (permalink / raw)
To: Rob Herring
Cc: DTML, Linux Kernel Mailing List, Geert Uytterhoeven,
Mike Turquette, Stephen Boyd, Tero Kristo, Linux-Renesas,
linux-clk, linux-omap, Linux ARM
On Wed, 5 Dec 2018 at 20:50, Rob Herring <robh@kernel.org> wrote:
>
> Convert string compares of DT node names to use of_node_name_eq helper
> instead. This removes direct access to the node name pointer.
>
> For instances using of_node_cmp, this has the side effect of now using
> case sensitive comparisons. This should not matter for any FDT based
> system which all of these are.
>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: Tero Kristo <t-kristo@ti.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
For the ux500 part:
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Kind regards
Uffe
> ---
> drivers/clk/renesas/clk-mstp.c | 2 +-
> drivers/clk/ti/clkctrl.c | 2 +-
> drivers/clk/ti/dpll.c | 2 +-
> drivers/clk/ux500/u8500_of_clk.c | 10 +++++-----
> 4 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
> index 1c1768c2cc82..765175d1148a 100644
> --- a/drivers/clk/renesas/clk-mstp.c
> +++ b/drivers/clk/renesas/clk-mstp.c
> @@ -280,7 +280,7 @@ int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
> goto found;
>
> /* BSC on r8a73a4/sh73a0 uses zb_clk instead of an mstp clock */
> - if (!strcmp(clkspec.np->name, "zb_clk"))
> + if (of_node_name_eq(clkspec.np, "zb_clk"))
> goto found;
>
> of_node_put(clkspec.np);
> diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
> index 469f560ae1cf..40630eb950fc 100644
> --- a/drivers/clk/ti/clkctrl.c
> +++ b/drivers/clk/ti/clkctrl.c
> @@ -448,7 +448,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
> char *c;
>
> if (!(ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT) &&
> - !strcmp(node->name, "clk"))
> + of_node_name_eq(node, "clk"))
> ti_clk_features.flags |= TI_CLK_CLKCTRL_COMPAT;
>
> addrp = of_get_address(node, 0, NULL, NULL);
> diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
> index 92e28af7afba..6c3329bc116f 100644
> --- a/drivers/clk/ti/dpll.c
> +++ b/drivers/clk/ti/dpll.c
> @@ -410,7 +410,7 @@ static void __init of_ti_omap3_dpll_setup(struct device_node *node)
>
> if ((of_machine_is_compatible("ti,omap3630") ||
> of_machine_is_compatible("ti,omap36xx")) &&
> - !strcmp(node->name, "dpll5_ck"))
> + of_node_name_eq(node, "dpll5_ck"))
> of_ti_dpll_setup(node, &omap3_dpll5_ck_ops, &dd);
> else
> of_ti_dpll_setup(node, &omap3_dpll_ck_ops, &dd);
> diff --git a/drivers/clk/ux500/u8500_of_clk.c b/drivers/clk/ux500/u8500_of_clk.c
> index d5888591e1a9..18a3c4522831 100644
> --- a/drivers/clk/ux500/u8500_of_clk.c
> +++ b/drivers/clk/ux500/u8500_of_clk.c
> @@ -545,21 +545,21 @@ static void u8500_clk_init(struct device_node *np)
> for_each_child_of_node(np, child) {
> static struct clk_onecell_data clk_data;
>
> - if (!of_node_cmp(child->name, "prcmu-clock")) {
> + if (of_node_name_eq(child, "prcmu-clock")) {
> clk_data.clks = prcmu_clk;
> clk_data.clk_num = ARRAY_SIZE(prcmu_clk);
> of_clk_add_provider(child, of_clk_src_onecell_get, &clk_data);
> }
> - if (!of_node_cmp(child->name, "prcc-periph-clock"))
> + if (of_node_name_eq(child, "prcc-periph-clock"))
> of_clk_add_provider(child, ux500_twocell_get, prcc_pclk);
>
> - if (!of_node_cmp(child->name, "prcc-kernel-clock"))
> + if (of_node_name_eq(child, "prcc-kernel-clock"))
> of_clk_add_provider(child, ux500_twocell_get, prcc_kclk);
>
> - if (!of_node_cmp(child->name, "rtc32k-clock"))
> + if (of_node_name_eq(child, "rtc32k-clock"))
> of_clk_add_provider(child, of_clk_src_simple_get, rtc_clk);
>
> - if (!of_node_cmp(child->name, "smp-twd-clock"))
> + if (of_node_name_eq(child, "smp-twd-clock"))
> of_clk_add_provider(child, of_clk_src_simple_get, twd_clk);
> }
> }
> --
> 2.19.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clk: Use of_node_name_eq for node name comparisons
2018-12-05 19:50 [PATCH] clk: Use of_node_name_eq for node name comparisons Rob Herring
` (2 preceding siblings ...)
2018-12-11 9:42 ` Ulf Hansson
@ 2018-12-14 21:53 ` Stephen Boyd
3 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2018-12-14 21:53 UTC (permalink / raw)
To: Rob Herring, devicetree, linux-kernel
Cc: Geert Uytterhoeven, Michael Turquette, Tero Kristo, Ulf Hansson,
linux-renesas-soc, linux-clk, linux-omap, linux-arm-kernel
Quoting Rob Herring (2018-12-05 11:50:21)
> Convert string compares of DT node names to use of_node_name_eq helper
> instead. This removes direct access to the node name pointer.
>
> For instances using of_node_cmp, this has the side effect of now using
> case sensitive comparisons. This should not matter for any FDT based
> system which all of these are.
>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@kernel.org>
> Cc: Tero Kristo <t-kristo@ti.com>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-12-14 21:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05 19:50 [PATCH] clk: Use of_node_name_eq for node name comparisons Rob Herring
2018-12-05 20:43 ` Stephen Boyd
2018-12-05 21:16 ` Geert Uytterhoeven
2018-12-11 9:42 ` Ulf Hansson
2018-12-14 21:53 ` Stephen Boyd
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).