Skip to content

Commit

Permalink
ARM: OMAP2+: CM: make some pointers and function arguments as const
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
  • Loading branch information
goyalbhumika authored and tmlind committed Dec 11, 2017
1 parent 4fbd8d1 commit a529f8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ int omap_cm_wait_module_idle(u8 part, s16 prcm_mod, u16 idlest_reg,
u8 idlest_shift);
int omap_cm_module_enable(u8 mode, u8 part, u16 inst, u16 clkctrl_offs);
int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs);
extern int cm_register(struct cm_ll_data *cld);
extern int cm_unregister(struct cm_ll_data *cld);
extern int cm_register(const struct cm_ll_data *cld);
extern int cm_unregister(const struct cm_ll_data *cld);
int omap_cm_init(void);
int omap2_cm_base_init(void);

Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-omap2/cm_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* common CM functions
*/
static struct cm_ll_data null_cm_ll_data;
static struct cm_ll_data *cm_ll_data = &null_cm_ll_data;
static const struct cm_ll_data *cm_ll_data = &null_cm_ll_data;

/* cm_base: base virtual address of the CM IP block */
struct omap_domain_base cm_base;
Expand Down Expand Up @@ -186,7 +186,7 @@ int omap_cm_module_disable(u8 part, u16 inst, u16 clkctrl_offs)
* is NULL, or -EEXIST if cm_register() has already been called
* without an intervening cm_unregister().
*/
int cm_register(struct cm_ll_data *cld)
int cm_register(const struct cm_ll_data *cld)
{
if (!cld)
return -EINVAL;
Expand All @@ -210,7 +210,7 @@ int cm_register(struct cm_ll_data *cld)
* -EINVAL if @cld is NULL or if @cld does not match the struct
* cm_ll_data * previously registered by cm_register().
*/
int cm_unregister(struct cm_ll_data *cld)
int cm_unregister(const struct cm_ll_data *cld)
{
if (!cld || cm_ll_data != cld)
return -EINVAL;
Expand Down

0 comments on commit a529f8d

Please sign in to comment.