clk: sprd: mark the local clock symbols static
Subsystems (2)
Chunyan Zhang
reviewerPATCH 1/2 clk: sprd: mark the local clock symbols static
From: Chunyan Zhang <[email protected]>
There's a few pll gate clocks which were not marked with static, and those clock are used only in the current file, so add static key word for them.
--- drivers/clk/sprd/sc9863a-clk.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/clk/sprd/sc9863a-clk.c +16 -16
@@ -23,22 +23,22 @@#include "pll.h" /* mpll*_gate clocks control cpu cores, they were enabled by default */ -SPRD_PLL_SC_GATE_CLK_FW_NAME (mpll0_gate,"mpll0-gate" ,"ext-26m" ,0x94 , -0x1000 ,BIT (0 ),CLK_IGNORE_UNUSED ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (dpll0_gate,"dpll0-gate" ,"ext-26m" ,0x98 , -0x1000 ,BIT (0 ),0 ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (lpll_gate,"lpll-gate" ,"ext-26m" ,0x9c , -0x1000 ,BIT (0 ),0 ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (gpll_gate,"gpll-gate" ,"ext-26m" ,0xa8 , -0x1000 ,BIT (0 ),0 ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (dpll1_gate,"dpll1-gate" ,"ext-26m" ,0x1dc , -0x1000 ,BIT (0 ),0 ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (mpll1_gate,"mpll1-gate" ,"ext-26m" ,0x1e0 , -0x1000 ,BIT (0 ),CLK_IGNORE_UNUSED ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (mpll2_gate,"mpll2-gate" ,"ext-26m" ,0x1e4 , -0x1000 ,BIT (0 ),CLK_IGNORE_UNUSED ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (isppll_gate,"isppll-gate" ,"ext-26m" ,0x1e8 , -0x1000 ,BIT (0 ),0 ,0 ,240 ); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll0_gate, "mpll0-gate", "ext-26m", 0x94, + 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll0_gate, "dpll0-gate", "ext-26m", 0x98, + 0x1000, BIT(0), 0, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(lpll_gate, "lpll-gate", "ext-26m", 0x9c, + 0x1000, BIT(0), 0, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(gpll_gate, "gpll-gate", "ext-26m", 0xa8, + 0x1000, BIT(0), 0, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll1_gate, "dpll1-gate", "ext-26m", 0x1dc, + 0x1000, BIT(0), 0, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll1_gate, "mpll1-gate", "ext-26m", 0x1e0, + 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll2_gate, "mpll2-gate", "ext-26m", 0x1e4, + 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(isppll_gate, "isppll-gate", "ext-26m", + 0x1e8, 0x1000, BIT(0), 0, 0, 240);static struct sprd_clk_common *sc9863a_pmu_gate_clks[] = {/* address base is 0x402b0000 */
Signature · 1 line
2.20.1
Chunyan Zhang
reviewerPATCH 2/2 clk: sprd: return correct type of value for _sprd_pll_recalc_rate
From: Chunyan Zhang <[email protected]>
The function _sprd_pll_recalc_rate() defines return value to unsigned long, but it would return a negative value when malloc fail, changing to return its parent_rate makes more sense, since if the callback .recalc_rate() is not set, the framework returns the parent_rate as well.
--- drivers/clk/sprd/pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sprd/pll.c +1 -1
@@ -106,7 +106,7 @@ static unsigned long _sprd_pll_recalc_rate(const struct sprd_pll *pll, cfg =kcalloc (regs_num,sizeof (*cfg),GFP_KERNEL );if (!cfg) -return -ENOMEM ; +return parent_rate;for (i =0 ; i < regs_num; i++) cfg[i] =sprd_pll_read (pll, i);
Signature · 1 line
2.20.1
Re: [PATCH 2/2] clk: sprd: return correct type of value for _sprd_pll_recalc_rate
Quoted 11 lines · Chunyan Zhang
From: Chunyan Zhang <[email protected]>
The function
_sprd_pll_recalc_rate()defines return value to unsigned long, but it would return a negative value when malloc fail, changing to return itsparent_ratemakes more sense, since if the callback .recalc_rate() is not set, the framework returns theparent_rateas well.Fixes 3e37b005580b ("clk: sprd: add adjustable pll support")Signed-off-by Chunyan Zhang <[email protected]>
Looks good to me.
Signature · 1 line
Baolin Wang
Re: [PATCH 2/2] clk: sprd: return correct type of value for _sprd_pll_recalc_rate
In reply to Chunyan ZhangQuoting Chunyan Zhang (2020-05-18 20:00:36)
Quoted 11 lines
From: Chunyan Zhang <[email protected]>
The function
_sprd_pll_recalc_rate()defines return value to unsigned long, but it would return a negative value when malloc fail, changing to return itsparent_ratemakes more sense, since if the callback .recalc_rate() is not set, the framework returns theparent_rateas well.Fixes 3e37b005580b ("clk: sprd: add adjustable pll support")Signed-off-by Chunyan Zhang <[email protected]>---
Applied to clk-next
Quoted 9 lines · Chunyan Zhang
From: Chunyan Zhang <[email protected]>
There's a few pll gate clocks which were not marked with static, and those clock are used only in the current file, so add static key word for them.
Fixes 0e4b8a2349f3 ("clk: sprd: add clocks support for SC9863A")Signed-off-by Chunyan Zhang <[email protected]>
Quoted 50 lines
--- drivers/clk/sprd/sc9863a-clk.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)drivers/clk/sprd/sc9863a-clk.c +16
-17@@ -23,22 +23,22 @@#include "pll.h" /* mpll*_gate clocks control cpu cores, they were enabled by default */ -SPRD_PLL_SC_GATE_CLK_FW_NAME (mpll0_gate,"mpll0-gate" ,"ext-26m" ,0x94 , -0x1000 ,BIT (0 ),CLK_IGNORE_UNUSED ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (dpll0_gate,"dpll0-gate" ,"ext-26m" ,0x98 , -0x1000 ,BIT (0 ),0 ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (lpll_gate,"lpll-gate" ,"ext-26m" ,0x9c , -0x1000 ,BIT (0 ),0 ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (gpll_gate,"gpll-gate" ,"ext-26m" ,0xa8 , -0x1000 ,BIT (0 ),0 ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (dpll1_gate,"dpll1-gate" ,"ext-26m" ,0x1dc , -0x1000 ,BIT (0 ),0 ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (mpll1_gate,"mpll1-gate" ,"ext-26m" ,0x1e0 , -0x1000 ,BIT (0 ),CLK_IGNORE_UNUSED ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (mpll2_gate,"mpll2-gate" ,"ext-26m" ,0x1e4 , -0x1000 ,BIT (0 ),CLK_IGNORE_UNUSED ,0 ,240 ); -SPRD_PLL_SC_GATE_CLK_FW_NAME (isppll_gate,"isppll-gate" ,"ext-26m" ,0x1e8 , -0x1000 ,BIT (0 ),0 ,0 ,240 ); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll0_gate, "mpll0-gate", "ext-26m", 0x94, + 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll0_gate, "dpll0-gate", "ext-26m", 0x98, + 0x1000, BIT(0), 0, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(lpll_gate, "lpll-gate", "ext-26m", 0x9c, + 0x1000, BIT(0), 0, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(gpll_gate, "gpll-gate", "ext-26m", 0xa8, + 0x1000, BIT(0), 0, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(dpll1_gate, "dpll1-gate", "ext-26m", 0x1dc, + 0x1000, BIT(0), 0, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll1_gate, "mpll1-gate", "ext-26m", 0x1e0, + 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(mpll2_gate, "mpll2-gate", "ext-26m", 0x1e4, + 0x1000, BIT(0), CLK_IGNORE_UNUSED, 0, 240); +static SPRD_PLL_SC_GATE_CLK_FW_NAME(isppll_gate, "isppll-gate", "ext-26m", + 0x1e8, 0x1000, BIT(0), 0, 0, 240);static struct sprd_clk_common *sc9863a_pmu_gate_clks[] = {/* address base is 0x402b0000 */ --2.20.1
Signature · 1 line
Baolin Wang
Quoting Chunyan Zhang (2020-05-18 20:00:35)
Quoted 9 lines
From: Chunyan Zhang <[email protected]>
There's a few pll gate clocks which were not marked with static, and those clock are used only in the current file, so add static key word for them.
Fixes 0e4b8a2349f3 ("clk: sprd: add clocks support for SC9863A")Signed-off-by Chunyan Zhang <[email protected]>---
Applied to clk-next