diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2017-11-06 08:15:39 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2017-12-11 10:40:34 -0500 |
commit | a529f8de260e33237204f18c6c1540212a9653c7 (patch) | |
tree | 8943b0dfbf41527c018a30536c0148e34ab33e57 | |
parent | 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff) |
ARM: OMAP2+: CM: make some pointers and function arguments as const
Make the pointer cm_ll_data of type cm_ll_data as const as it does not
modify the fields of the structure it points too.
After this change, make the argument of cm_register function as const as
it is used to initialise cm_ll_data or used inside an if condition.
Make the pointer argument of cm_unregister function as const as it is only
used inside an if condition.
Add const to the function prototypes too.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r-- | arch/arm/mach-omap2/cm.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm_common.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h index e833984cc85e..7b66e179e44e 100644 --- a/arch/arm/mach-omap2/cm.h +++ b/arch/arm/mach-omap2/cm.h | |||
@@ -72,8 +72,8 @@ int omap_cm_wait_module_idle(u8 part, s16 prcm_mod, u16 idlest_reg, | |||
72 | u8 idlest_shift); | 72 | u8 idlest_shift); |
73 | int omap_cm_module_enable(u8 mode, u8 part, u16 inst, u16 clkctrl_offs); | 73 | int omap_cm_module_enable(u8 mode, u8 part, u16 inst, u16 clkctrl_offs); |
74 | int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs); | 74 | int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs); |
75 | extern int cm_register(struct cm_ll_data *cld); | 75 | extern int cm_register(const struct cm_ll_data *cld); |
76 | extern int cm_unregister(struct cm_ll_data *cld); | 76 | extern int cm_unregister(const struct cm_ll_data *cld); |
77 | int omap_cm_init(void); | 77 | int omap_cm_init(void); |
78 | int omap2_cm_base_init(void); | 78 | int omap2_cm_base_init(void); |
79 | 79 | ||
diff --git a/arch/arm/mach-omap2/cm_common.c b/arch/arm/mach-omap2/cm_common.c index d555791cf349..de9cdce27b83 100644 --- a/arch/arm/mach-omap2/cm_common.c +++ b/arch/arm/mach-omap2/cm_common.c | |||
@@ -29,7 +29,7 @@ | |||
29 | * common CM functions | 29 | * common CM functions |
30 | */ | 30 | */ |
31 | static struct cm_ll_data null_cm_ll_data; | 31 | static struct cm_ll_data null_cm_ll_data; |
32 | static struct cm_ll_data *cm_ll_data = &null_cm_ll_data; | 32 | static const struct cm_ll_data *cm_ll_data = &null_cm_ll_data; |
33 | 33 | ||
34 | /* cm_base: base virtual address of the CM IP block */ | 34 | /* cm_base: base virtual address of the CM IP block */ |
35 | struct omap_domain_base cm_base; | 35 | struct omap_domain_base cm_base; |
@@ -186,7 +186,7 @@ int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs) | |||
186 | * is NULL, or -EEXIST if cm_register() has already been called | 186 | * is NULL, or -EEXIST if cm_register() has already been called |
187 | * without an intervening cm_unregister(). | 187 | * without an intervening cm_unregister(). |
188 | */ | 188 | */ |
189 | int cm_register(struct cm_ll_data *cld) | 189 | int cm_register(const struct cm_ll_data *cld) |
190 | { | 190 | { |
191 | if (!cld) | 191 | if (!cld) |
192 | return -EINVAL; | 192 | return -EINVAL; |
@@ -210,7 +210,7 @@ int cm_register(struct cm_ll_data *cld) | |||
210 | * -EINVAL if @cld is NULL or if @cld does not match the struct | 210 | * -EINVAL if @cld is NULL or if @cld does not match the struct |
211 | * cm_ll_data * previously registered by cm_register(). | 211 | * cm_ll_data * previously registered by cm_register(). |
212 | */ | 212 | */ |
213 | int cm_unregister(struct cm_ll_data *cld) | 213 | int cm_unregister(const struct cm_ll_data *cld) |
214 | { | 214 | { |
215 | if (!cld || cm_ll_data != cld) | 215 | if (!cld || cm_ll_data != cld) |
216 | return -EINVAL; | 216 | return -EINVAL; |