2017-08-28 07:03:47

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/3] constify ux500 clk_ops.

clk_ops are not supposed to change at runtime. All functions
working with clk_ops provided by <linux/clk-provider.h> work
with const clk_ops. So mark the non-const clk_ops as const.

Here, Function "clk_reg_prcc" is used to initialized clk_init_data.
clk_init_data is working with const clk_ops. So make clk_reg_prcc
non-const clk_ops argument as const.

Arvind Yadav (3):
[PATCH 1/3] clk: ux500: prcmu: constify clk_ops.
[PATCH 2/3] clk: ux500: sysctrl: constify clk_ops.
[PATCH 3/3] clk: ux500: prcc: constify clk_ops.

drivers/clk/ux500/clk-prcc.c | 6 +++---
drivers/clk/ux500/clk-prcmu.c | 14 +++++++-------
drivers/clk/ux500/clk-sysctrl.c | 8 ++++----
3 files changed, 14 insertions(+), 14 deletions(-)

--
1.9.1


2017-08-28 07:03:52

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/3] clk: ux500: prcmu: constify clk_ops.

clk_ops are not supposed to change at runtime. All functions
working with clk_ops provided by <linux/clk-provider.h> work
with const clk_ops. So mark the non-const clk_ops as const.

Here, Function "clk_reg_prcmu" is used to initialized clk_init_data.
clk_init_data is working with const clk_ops. So make clk_reg_prcmu
non-const clk_ops argument as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/clk/ux500/clk-prcmu.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/ux500/clk-prcmu.c b/drivers/clk/ux500/clk-prcmu.c
index 7f34382..6e3e16b 100644
--- a/drivers/clk/ux500/clk-prcmu.c
+++ b/drivers/clk/ux500/clk-prcmu.c
@@ -186,7 +186,7 @@ static void clk_prcmu_opp_volt_unprepare(struct clk_hw *hw)
clk->is_prepared = 0;
}

-static struct clk_ops clk_prcmu_scalable_ops = {
+static const struct clk_ops clk_prcmu_scalable_ops = {
.prepare = clk_prcmu_prepare,
.unprepare = clk_prcmu_unprepare,
.is_prepared = clk_prcmu_is_prepared,
@@ -198,7 +198,7 @@ static void clk_prcmu_opp_volt_unprepare(struct clk_hw *hw)
.set_rate = clk_prcmu_set_rate,
};

-static struct clk_ops clk_prcmu_gate_ops = {
+static const struct clk_ops clk_prcmu_gate_ops = {
.prepare = clk_prcmu_prepare,
.unprepare = clk_prcmu_unprepare,
.is_prepared = clk_prcmu_is_prepared,
@@ -208,19 +208,19 @@ static void clk_prcmu_opp_volt_unprepare(struct clk_hw *hw)
.recalc_rate = clk_prcmu_recalc_rate,
};

-static struct clk_ops clk_prcmu_scalable_rate_ops = {
+static const struct clk_ops clk_prcmu_scalable_rate_ops = {
.is_enabled = clk_prcmu_is_enabled,
.recalc_rate = clk_prcmu_recalc_rate,
.round_rate = clk_prcmu_round_rate,
.set_rate = clk_prcmu_set_rate,
};

-static struct clk_ops clk_prcmu_rate_ops = {
+static const struct clk_ops clk_prcmu_rate_ops = {
.is_enabled = clk_prcmu_is_enabled,
.recalc_rate = clk_prcmu_recalc_rate,
};

-static struct clk_ops clk_prcmu_opp_gate_ops = {
+static const struct clk_ops clk_prcmu_opp_gate_ops = {
.prepare = clk_prcmu_opp_prepare,
.unprepare = clk_prcmu_opp_unprepare,
.is_prepared = clk_prcmu_is_prepared,
@@ -230,7 +230,7 @@ static void clk_prcmu_opp_volt_unprepare(struct clk_hw *hw)
.recalc_rate = clk_prcmu_recalc_rate,
};

-static struct clk_ops clk_prcmu_opp_volt_scalable_ops = {
+static const struct clk_ops clk_prcmu_opp_volt_scalable_ops = {
.prepare = clk_prcmu_opp_volt_prepare,
.unprepare = clk_prcmu_opp_volt_unprepare,
.is_prepared = clk_prcmu_is_prepared,
@@ -247,7 +247,7 @@ static struct clk *clk_reg_prcmu(const char *name,
u8 cg_sel,
unsigned long rate,
unsigned long flags,
- struct clk_ops *clk_prcmu_ops)
+ const struct clk_ops *clk_prcmu_ops)
{
struct clk_prcmu *clk;
struct clk_init_data clk_prcmu_init;
--
1.9.1

2017-08-28 07:03:57

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/3] clk: ux500: prcc: constify clk_ops.

clk_ops are not supposed to change at runtime. All functions
working with clk_ops provided by <linux/clk-provider.h> work
with const clk_ops. So mark the non-const clk_ops as const.

Here, Function "clk_reg_prcc" is used to initialized clk_init_data.
clk_init_data is working with const clk_ops. So make clk_reg_prcc
non-const clk_ops argument as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/clk/ux500/clk-prcc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/ux500/clk-prcc.c b/drivers/clk/ux500/clk-prcc.c
index 0e95076..f505927 100644
--- a/drivers/clk/ux500/clk-prcc.c
+++ b/drivers/clk/ux500/clk-prcc.c
@@ -79,13 +79,13 @@ static int clk_prcc_is_enabled(struct clk_hw *hw)
return clk->is_enabled;
}

-static struct clk_ops clk_prcc_pclk_ops = {
+static const struct clk_ops clk_prcc_pclk_ops = {
.enable = clk_prcc_pclk_enable,
.disable = clk_prcc_pclk_disable,
.is_enabled = clk_prcc_is_enabled,
};

-static struct clk_ops clk_prcc_kclk_ops = {
+static const struct clk_ops clk_prcc_kclk_ops = {
.enable = clk_prcc_kclk_enable,
.disable = clk_prcc_kclk_disable,
.is_enabled = clk_prcc_is_enabled,
@@ -96,7 +96,7 @@ static struct clk *clk_reg_prcc(const char *name,
resource_size_t phy_base,
u32 cg_sel,
unsigned long flags,
- struct clk_ops *clk_prcc_ops)
+ const struct clk_ops *clk_prcc_ops)
{
struct clk_prcc *clk;
struct clk_init_data clk_prcc_init;
--
1.9.1

2017-08-28 07:04:24

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/3] clk: ux500: sysctrl: constify clk_ops.

clk_ops are not supposed to change at runtime. All functions
working with clk_ops provided by <linux/clk-provider.h> work
with const clk_ops. So mark the non-const clk_ops as const.

Here, Function "clk_reg_sysctrl" is used to initialized clk_init_data.
clk_init_data is working with const clk_ops. So make clk_reg_sysctrl
non-const clk_ops argument as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/clk/ux500/clk-sysctrl.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c
index 266ddea..8a4e93c 100644
--- a/drivers/clk/ux500/clk-sysctrl.c
+++ b/drivers/clk/ux500/clk-sysctrl.c
@@ -98,18 +98,18 @@ static u8 clk_sysctrl_get_parent(struct clk_hw *hw)
return clk->parent_index;
}

-static struct clk_ops clk_sysctrl_gate_ops = {
+static const struct clk_ops clk_sysctrl_gate_ops = {
.prepare = clk_sysctrl_prepare,
.unprepare = clk_sysctrl_unprepare,
};

-static struct clk_ops clk_sysctrl_gate_fixed_rate_ops = {
+static const struct clk_ops clk_sysctrl_gate_fixed_rate_ops = {
.prepare = clk_sysctrl_prepare,
.unprepare = clk_sysctrl_unprepare,
.recalc_rate = clk_sysctrl_recalc_rate,
};

-static struct clk_ops clk_sysctrl_set_parent_ops = {
+static const struct clk_ops clk_sysctrl_set_parent_ops = {
.set_parent = clk_sysctrl_set_parent,
.get_parent = clk_sysctrl_get_parent,
};
@@ -124,7 +124,7 @@ static struct clk *clk_reg_sysctrl(struct device *dev,
unsigned long rate,
unsigned long enable_delay_us,
unsigned long flags,
- struct clk_ops *clk_sysctrl_ops)
+ const struct clk_ops *clk_sysctrl_ops)
{
struct clk_sysctrl *clk;
struct clk_init_data clk_sysctrl_init;
--
1.9.1

2017-08-30 11:37:07

by Ulf Hansson

[permalink] [raw]
Subject: Re: [PATCH 0/3] constify ux500 clk_ops.

On 28 August 2017 at 09:02, Arvind Yadav <[email protected]> wrote:
> clk_ops are not supposed to change at runtime. All functions
> working with clk_ops provided by <linux/clk-provider.h> work
> with const clk_ops. So mark the non-const clk_ops as const.
>
> Here, Function "clk_reg_prcc" is used to initialized clk_init_data.
> clk_init_data is working with const clk_ops. So make clk_reg_prcc
> non-const clk_ops argument as const.
>
> Arvind Yadav (3):
> [PATCH 1/3] clk: ux500: prcmu: constify clk_ops.
> [PATCH 2/3] clk: ux500: sysctrl: constify clk_ops.
> [PATCH 3/3] clk: ux500: prcc: constify clk_ops.
>
> drivers/clk/ux500/clk-prcc.c | 6 +++---
> drivers/clk/ux500/clk-prcmu.c | 14 +++++++-------
> drivers/clk/ux500/clk-sysctrl.c | 8 ++++----
> 3 files changed, 14 insertions(+), 14 deletions(-)
>
> --
> 1.9.1
>

Acked-by: Ulf Hansson <[email protected]>

Mike, Stephen, can you pick this up?

Kind regards
Uffe

2017-08-31 05:28:51

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 1/3] clk: ux500: prcmu: constify clk_ops.

On 08/28, Arvind Yadav wrote:
> clk_ops are not supposed to change at runtime. All functions
> working with clk_ops provided by <linux/clk-provider.h> work
> with const clk_ops. So mark the non-const clk_ops as const.
>
> Here, Function "clk_reg_prcmu" is used to initialized clk_init_data.
> clk_init_data is working with const clk_ops. So make clk_reg_prcmu
> non-const clk_ops argument as const.
>
> Signed-off-by: Arvind Yadav <[email protected]>
> ---

Applied to clk-next

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

2017-08-31 05:28:59

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 3/3] clk: ux500: prcc: constify clk_ops.

On 08/28, Arvind Yadav wrote:
> clk_ops are not supposed to change at runtime. All functions
> working with clk_ops provided by <linux/clk-provider.h> work
> with const clk_ops. So mark the non-const clk_ops as const.
>
> Here, Function "clk_reg_prcc" is used to initialized clk_init_data.
> clk_init_data is working with const clk_ops. So make clk_reg_prcc
> non-const clk_ops argument as const.
>
> Signed-off-by: Arvind Yadav <[email protected]>
> ---

Applied to clk-next

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

2017-08-31 05:28:56

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 2/3] clk: ux500: sysctrl: constify clk_ops.

On 08/28, Arvind Yadav wrote:
> clk_ops are not supposed to change at runtime. All functions
> working with clk_ops provided by <linux/clk-provider.h> work
> with const clk_ops. So mark the non-const clk_ops as const.
>
> Here, Function "clk_reg_sysctrl" is used to initialized clk_init_data.
> clk_init_data is working with const clk_ops. So make clk_reg_sysctrl
> non-const clk_ops argument as const.
>
> Signed-off-by: Arvind Yadav <[email protected]>
> ---

Applied to clk-next

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project