OF init section function prototype fixes
Subsystems (10)
cover OF init section function prototype fixes
From: Rob Herring <[email protected]>
This series fixes the function prototypes of various OF initiaiization callback functions. I found these when adding type checking. I intend to merge this thru the DT tree with the series that adds the type checking[1].
Rob
[1] https://lkml.org/lkml/2014/5/8/667
Rob Herring (7):
ARM: imx: fix function type for CLK_OF_DECLARE
clk: rockchip: fix function type for CLK_OF_DECLARE
clk: sunxi: avoid double DT matching
clk: sunxi: fix function type for CLK_OF_DECLARE
irqchip: s3c24xx: fix function type for IRQCHIP_OF_DECLARE
irqchip: mxs: fix function type for IRQCHIP_OF_DECLARE
clk: ti: add missing semi-colon on CLK_OF_DECLARE
arch/arm/mach-imx/clk-imx35.c | 4 +--- drivers/clk/rockchip/clk-rockchip.c | 3 +-- drivers/clk/sunxi/clk-sunxi.c | 5 ++--- drivers/clk/ti/gate.c | 2 +- drivers/irqchip/irq-mxs.c | 4 ++-- drivers/irqchip/irq-s3c24xx.c | 6 ++---- 6 files changed, 9 insertions(+), 15 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/7 ARM: imx: fix function type for CLK_OF_DECLARE
From: Rob Herring <[email protected]>
Adding function type checking to CLK_OF_DECLARE found a type mismatch with mx35_clocks_init_dt. The function should return void.
--- arch/arm/mach-imx/clk-imx35.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm/mach-imx/clk-imx35.c +1 -3
@@ -289,14 +289,12 @@ int __init mx35_clocks_init(void)return 0 ; } -static int __init mx35_clocks_init_dt (struct device_node *ccm_node) +static void __init mx35_clocks_init_dt (struct device_node *ccm_node) { clk_data.clks = clk; clk_data.clk_num =ARRAY_SIZE (clk);of_clk_add_provider (ccm_node, of_clk_src_onecell_get, &clk_data);mx35_clocks_init (); - -return 0 ; }CLK_OF_DECLARE (imx35,"fsl,imx35-ccm" , mx35_clocks_init_dt);
Signature · 1 line
1.9.1
Re: [PATCH 1/7] ARM: imx: fix function type for CLK_OF_DECLARE
Quoted 8 lines · Rob Herring
From: Rob Herring <[email protected]>
Adding function type checking to
CLK_OF_DECLAREfound a type mismatch withmx35_clocks_init_dt. The function should return void.Signed-off-by Rob Herring <[email protected]>Cc Shawn Guo <[email protected]>Cc Sascha Hauer <[email protected]>
PATCH 2/7 clk: rockchip: fix function type for CLK_OF_DECLARE
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Adding function type checking to CLK_OF_DECLARE found a type mismatch with rk2928_gate_clk_init. The function only takes a single struct device_node parameter.
--- drivers/clk/rockchip/clk-rockchip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/rockchip/clk-rockchip.c +1 -2
@@ -24,8 +24,7 @@ static DEFINE_SPINLOCK(clk_lock);* Gate clocks */ -static void __init rk2928_gate_clk_init (struct device_node *node, -void *data) +static void __init rk2928_gate_clk_init (struct device_node *node) {struct clk_onecell_data *clk_data;const char *clk_parent;
Signature · 1 line
1.9.1
PATCH 3/7 clk: sunxi: avoid double DT matching
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Use for_each_matching_node_and_match instead of for_each_matching_node plus of_match_node to avoid searching the DT twice for each node.
The sunxi DT scanning code should really be re-worked rather than have its own private matching infrastructure. It is working around needing a function pointer and a data pointer for each compatible match.
--- drivers/clk/sunxi/clk-sunxi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/sunxi/clk-sunxi.c +1 -2
@@ -1278,8 +1278,7 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_matconst struct of_device_id *match;void (*setup_function)(struct device_node *,const void *) = function; -for_each_matching_node (np, clk_match) { - match =of_match_node (clk_match, np); +for_each_matching_node_and_match (np, clk_match, match) { data = match->data;setup_function (np, data); }
Signature · 1 line
1.9.1
Re: [PATCH 3/7] clk: sunxi: avoid double DT matching
Quoted 22 lines · Rob Herring
From: Rob Herring <[email protected]>
Use
for_each_matching_node_and_matchinstead offor_each_matching_nodeplusof_match_nodeto avoid searching the DT twice for each node.The sunxi DT scanning code should really be re-worked rather than have its own private matching infrastructure. It is working around needing a function pointer and a data pointer for each compatible match.
Signed-off-by Rob Herring <[email protected]>Cc "Emilio L?pez" <[email protected]>Cc Mike Turquette <[email protected]>Cc Maxime Ripard <[email protected]>--- drivers/clk/sunxi/clk-sunxi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/clk/sunxi/clk-sunxi.c +0
-0
drivers/clk/sunxi/clk-sunxi.c static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_mat · line 1281
Quoted 6 lines
drivers/clk/sunxi/clk-sunxi.c +1
-2@@ -1278,8 +1278,7 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_matconst struct of_device_id *match;void (*setup_function)(struct device_node *,const void *) = function; -for_each_matching_node (np, clk_match) { - match =of_match_node (clk_match, np); +for_each_matching_node_and_match (np, clk_match, match) {
I missed folding in a fix and this should be &match instead of match.
Rob
Quoted 6 lines
drivers/clk/sunxi/clk-sunxi.c +0
-1data = match->data;setup_function (np, data); } --1.9.1
Re: [PATCH 3/7] clk: sunxi: avoid double DT matching
Hi Rob,
For 3/7 (with the mentioned fix) and 4/7 my Cubietruck still boots, so
El 13/05/14 12:12, Rob Herring escribi?:
Quoted 6 lines · Rob Herring
Quoted 5 lines
From: Rob Herring <[email protected]>
Use
for_each_matching_node_and_matchinstead offor_each_matching_nodeplusof_match_nodeto avoid searching the DT twice for each node.
Quoted 8 lines
Quoted 8 lines
The sunxi DT scanning code should really be re-worked rather than have its own private matching infrastructure. It is working around needing a function pointer and a data pointer for each compatible match.
Signed-off-by Rob Herring <[email protected]>Cc "Emilio L?pez" <[email protected]>Cc Mike Turquette <[email protected]>Cc Maxime Ripard <[email protected]>
Cheers,
Emilio
PATCH 4/7 clk: sunxi: fix function type for CLK_OF_DECLARE
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Adding function type checking to CLK_OF_DECLARE found a type mismatch with sunxi_init_clocks. The function takes a single struct device_node parameter.
--- drivers/clk/sunxi/clk-sunxi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi/clk-sunxi.c +1 -1
@@ -1309,7 +1309,7 @@ static void __init sunxi_clock_protect(void) } } -static void __init sunxi_init_clocks (void ) +static void __init sunxi_init_clocks (struct device_node *np) {/* Register factor clocks */ of_sunxi_table_clock_setup (clk_factors_match, sunxi_factors_clk_setup);
Signature · 1 line
1.9.1
PATCH 5/7 irqchip: s3c24xx: fix function type for IRQCHIP_OF_DECLARE
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Adding function type checking to IRQCHIP_OF_DECLARE found a type mismatch with s3c2410_init_intc_of and s3c2416_init_intc_of. The function only takes the 1st 2 parameters.
--- drivers/irqchip/irq-s3c24xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/irqchip/irq-s3c24xx.c +2 -4
@@ -1323,8 +1323,7 @@ static struct s3c24xx_irq_of_ctrl s3c2410_ctrl[] = { };int __init s3c2410_init_intc_of (struct device_node *np, -struct device_node *interrupt_parent, -struct s3c24xx_irq_of_ctrl *ctrl,int num_ctrl) +struct device_node *interrupt_parent) {return s3c_init_intc_of (np, interrupt_parent, s3c2410_ctrl,ARRAY_SIZE (s3c2410_ctrl));
@@ -1346,8 +1345,7 @@ static struct s3c24xx_irq_of_ctrl s3c2416_ctrl[] = { };int __init s3c2416_init_intc_of (struct device_node *np, -struct device_node *interrupt_parent, -struct s3c24xx_irq_of_ctrl *ctrl,int num_ctrl) +struct device_node *interrupt_parent) {return s3c_init_intc_of (np, interrupt_parent, s3c2416_ctrl,ARRAY_SIZE (s3c2416_ctrl));
Signature · 1 line
1.9.1
Re: [PATCH 5/7] irqchip: s3c24xx: fix function type for IRQCHIP_OF_DECLARE
Rob,
Quoted 11 lines · Rob Herring
From: Rob Herring <[email protected]>
Adding function type checking to
IRQCHIP_OF_DECLAREfound a type mismatch withs3c2410_init_intc_ofands3c2416_init_intc_of. The function only takes the 1st 2 parameters.Signed-off-by Rob Herring <[email protected]>Cc Thomas Gleixner <[email protected]>--- drivers/irqchip/irq-s3c24xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Thomas has asked me to give him a hand with the patches for drivers/irqchip. When you add these two to your tree, could you amend the subject line to conform with the other patches in that directory?
eg (note the capitalization on 'Fix'):
irqchip: s3c24xx: Fix function type for IRQCHIP_OF_DECLARE
irqchip: mxs: Fix function type for IRQCHIP_OF_DECLARE
With that change,
Or, if you like, I can apply these two to the branch I'm staging for Thomas. Either is fine with me.
thx,
Jason.
Re: [PATCH 5/7] irqchip: s3c24xx: fix function type for IRQCHIP_OF_DECLARE
Quoted 15 lines · Jason Cooper
Rob,
Quoted 11 lines · Rob Herring
From: Rob Herring <[email protected]>
Adding function type checking to
IRQCHIP_OF_DECLAREfound a type mismatch withs3c2410_init_intc_ofands3c2416_init_intc_of. The function only takes the 1st 2 parameters.Signed-off-by Rob Herring <[email protected]>Cc Thomas Gleixner <[email protected]>--- drivers/irqchip/irq-s3c24xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Quoted 3 lines
Thomas has asked me to give him a hand with the patches for
drivers/irqchip. When you add these two to your tree, could you amend the subject line to conform with the other patches in that directory?
Excellent! We've needed some help there for a long time. Is there a patch in flight to add this to MAINTAINERS.
Quoted 4 lines
eg (note the capitalization on 'Fix'):
irqchip: s3c24xx: Fix function type for
IRQCHIP_OF_DECLARE
irqchip: mxs: Fix function type forIRQCHIP_OF_DECLARE
Will do.
Quoted 11 lines
With that change,
Acked-by Jason Cooper <[email protected]>Or, if you like, I can apply these two to the branch I'm staging for Thomas. Either is fine with me.
thx,
Jason.
Re: [PATCH 5/7] irqchip: s3c24xx: fix function type for IRQCHIP_OF_DECLARE
Quoted 16 lines · Rob Herring
Quoted 15 lines · Jason Cooper
Rob,
Quoted 11 lines · Rob Herring
From: Rob Herring <[email protected]>
Adding function type checking to
IRQCHIP_OF_DECLAREfound a type mismatch withs3c2410_init_intc_ofands3c2416_init_intc_of. The function only takes the 1st 2 parameters.Signed-off-by Rob Herring <[email protected]>Cc Thomas Gleixner <[email protected]>--- drivers/irqchip/irq-s3c24xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Quoted 6 lines
Quoted 3 lines
Thomas has asked me to give him a hand with the patches for
drivers/irqchip. When you add these two to your tree, could you amend the subject line to conform with the other patches in that directory?Excellent! We've needed some help there for a long time. Is there a patch in flight to add this to
MAINTAINERS.
See:
https://lkml.kernel.org/r/1400006821-32145-1-git-send-email-jason at lakedaemon.net
and it's now in irq/urgent in the tip tree.
thx,
Jason.
PATCH 6/7 irqchip: mxs: fix function type for IRQCHIP_OF_DECLARE
In reply to Rob HerringFrom: Rob Herring <[email protected]>
Adding function type checking to IRQCHIP_OF_DECLARE found a type mismatch with icoll_of_init. The function should return an error code or 0 on success.
--- drivers/irqchip/irq-mxs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/irqchip/irq-mxs.c +2 -2
@@ -96,7 +96,7 @@ static struct irq_domain_ops icoll_irq_domain_ops = { .xlate = irq_domain_xlate_onecell, }; -static void __init icoll_of_init (struct device_node *np, +static int __init icoll_of_init (struct device_node *np,struct device_node *interrupt_parent) { icoll_base =of_iomap (np,0 );
@@ -110,6 +110,6 @@ static void __init icoll_of_init(struct device_node *np, icoll_domain =irq_domain_add_linear (np,ICOLL_NUM_IRQS , &icoll_irq_domain_ops,NULL ); -WARN_ON (!icoll_domain); +return icoll_domain ?0 : -ENODEV ; }IRQCHIP_DECLARE (mxs,"fsl,icoll" , icoll_of_init);
Signature · 1 line
1.9.1
PATCH 7/7 clk: ti: add missing semi-colon on CLK_OF_DECLARE
In reply to Rob HerringFrom: Rob Herring <[email protected]>
With common OF_DECLARE macros, a semi-colon will be required for CLK_OF_DECLARE. Add the missing semi-colon to ti,gate-clock.
--- drivers/clk/ti/gate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/gate.c +1 -1
@@ -221,7 +221,7 @@ static void __init of_ti_gate_clk_setup(struct device_node *node) {_of_ti_gate_clk_setup (node, &omap_gate_clk_ops,NULL ); } -CLK_OF_DECLARE(ti_gate_clk, "ti,gate-clock", of_ti_gate_clk_setup) +CLK_OF_DECLARE (ti_gate_clk,"ti,gate-clock" , of_ti_gate_clk_setup);static void __init of_ti_wait_gate_clk_setup (struct device_node *node) {
Signature · 1 line
1.9.1