clk: Use of_node_name_eq for node name comparisons
Subsystems (4)
PATCH 1/1 clk: Use of_node_name_eq for node name comparisons
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.
--- 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(-)
drivers/clk/renesas/clk-mstp.c +1 -1
@@ -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);
drivers/clk/ti/clkctrl.c +1 -1
@@ -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 );
drivers/clk/ti/dpll.c +1 -1
@@ -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);
drivers/clk/ux500/u8500_of_clk.c +5 -5
@@ -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); } }
Signature · 1 line
2.19.1
Stephen Boyd
maintainerQuoting Rob Herring (2018-12-05 11:50:21)
Quoted 17 lines
Convert string compares of DT node names to use
of_node_name_eqhelper 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 <[email protected]>Cc Michael Turquette <[email protected]>Cc Stephen Boyd <[email protected]>Cc Tero Kristo <[email protected]>Cc Ulf Hansson <[email protected]>Signed-off-by Rob Herring <[email protected]>
Quoted 1 line
---
Looks ok at a glance. I'll wait for some people to ack or test it.
Quoted 7 lines · Rob Herring
Convert string compares of DT node names to use
of_node_name_eqhelper 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.
Quoted 10 lines
Cc Geert Uytterhoeven <[email protected]>Cc Michael Turquette <[email protected]>Cc Stephen Boyd <[email protected]>Cc Tero Kristo <[email protected]>Cc Ulf Hansson <[email protected]>Signed-off-by Rob Herring <[email protected]>
Quoted 6 lines
--- 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 :
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] 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
Quoted 8 lines · Rob Herring
Convert string compares of DT node names to use
of_node_name_eqhelper 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.
Quoted 10 lines
Cc Geert Uytterhoeven <[email protected]>Cc Michael Turquette <[email protected]>Cc Stephen Boyd <[email protected]>Cc Tero Kristo <[email protected]>Cc Ulf Hansson <[email protected]>Signed-off-by Rob Herring <[email protected]>
For the ux500 part:
Kind regards
Uffe
Quoted 80 lines
--- 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(-)drivers/clk/renesas/clk-mstp.c +1
-1@@ -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);drivers/clk/ti/clkctrl.c +1
-1@@ -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 );drivers/clk/ti/dpll.c +1
-1@@ -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);drivers/clk/ux500/u8500_of_clk.c +5
-6@@ -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
Quoting Rob Herring (2018-12-05 11:50:21)
Quoted 17 lines
Convert string compares of DT node names to use
of_node_name_eqhelper 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 <[email protected]>Cc Michael Turquette <[email protected]>Cc Stephen Boyd <[email protected]>Cc Tero Kristo <[email protected]>Cc Ulf Hansson <[email protected]>Signed-off-by Rob Herring <[email protected]>
Quoted 1 line
---
Applied to clk-next