clk: mxs: Remove unneeded NULL pointer check
Subsystems (2)
Fabio Estevam
reviewerPATCH 1/1 clk: mxs: Remove unneeded NULL pointer check
From: Fabio Estevam <[email protected]>
mxs platform has been converted to device tree.
There is no need to check if np is NULL after doing:
np = of_find_compatible_node(NULL, NULL, "fsl,imx[23/28]-clkctrl");
,as it will always be non-NULL.
--- drivers/clk/mxs/clk-imx23.c | 8 +++----- drivers/clk/mxs/clk-imx28.c | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-)
drivers/clk/mxs/clk-imx23.c +3 -5
@@ -154,11 +154,9 @@ int __init mx23_clocks_init(void) } np =of_find_compatible_node (NULL ,NULL ,"fsl,imx23-clkctrl" ); -if (np) { - clk_data.clks = clks; - clk_data.clk_num =ARRAY_SIZE (clks); -of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data); - } + clk_data.clks = clks; + clk_data.clk_num =ARRAY_SIZE (clks); +of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data);clk_register_clkdev (clks[clk32k],NULL ,"timrot" );
drivers/clk/mxs/clk-imx28.c +3 -5
@@ -232,11 +232,9 @@ int __init mx28_clocks_init(void) } np =of_find_compatible_node (NULL ,NULL ,"fsl,imx28-clkctrl" ); -if (np) { - clk_data.clks = clks; - clk_data.clk_num =ARRAY_SIZE (clks); -of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data); - } + clk_data.clks = clks; + clk_data.clk_num =ARRAY_SIZE (clks); +of_clk_add_provider (np, of_clk_src_onecell_get, &clk_data);clk_register_clkdev (clks[clk32k],NULL ,"timrot" );clk_register_clkdev (clks[enet_out],NULL ,"enet_out" );
Signature · 1 line
1.7.9.5
Fabio Estevam
reviewerShawn/Mike,
Quoted 11 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
mxs platform has been converted to device tree.
There is no need to check if np is NULL after doing:
np =
of_find_compatible_node(NULL, NULL, "fsl,imx[23/28]-clkctrl");,as it will always be non-NULL.
Signed-off-by Fabio Estevam <[email protected]>
Does this patch look good?
Quoted 9 lines · Fabio Estevam
Shawn/Mike,
Quoted 6 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
mxs platform has been converted to device tree.
There is no need to check if np is NULL after doing:
Quoted 7 lines
Quoted 5 lines
np =
of_find_compatible_node(NULL, NULL, "fsl,imx[23/28]-clkctrl");,as it will always be non-NULL.
Signed-off-by Fabio Estevam <[email protected]>Does this patch look good?
Hmm, technically the check is still valid, as np can be NULL if the clkctrl node with correct compatible string is not present.
Shawn