Skip to contentSkip to conversation

OMAP3: PM: Fix compile time warning and errors

PATCH In review Sanjeev Premi 2 participants 2 messages Sep 18, 2009 – Sep 30, 2009

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP3: PM: Fix compile time warning and errors

Made a mistake of enabling PM_DEBUG without DEBUG_FS. This leads to compile time warnings and errors.

arch/arm/mach-omap2/pm-debug.c:56: warning: 'pm_dbg_init'
declared 'static' but never defined

arch/arm/mach-omap2/built-in.o: In function `omap_sram_idle':
arch/arm/mach-omap2/pm34xx.c:442: undefined reference to
'pm_dbg_regset_save'
arch/arm/mach-omap2/built-in.o: In function `configure_vc':
arch/arm/mach-omap2/pm34xx.c:1221: undefined reference to
'pm_dbg_regset_init'

Another alternate is to link these Kconfig options; but didn't seem intuitive.

---
 arch/arm/mach-omap2/pm-debug.c |    2 ++
 arch/arm/mach-omap2/pm34xx.c   |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm-debug.c +2 -0
index 1b4c160..175d461 100644
@@ -53,7 +53,9 @@ int omap2_pm_debug;
 	regs[reg_count].name = #reg; \
 	regs[reg_count++].val = __raw_readl(OMAP2_IO_ADDRESS(0x480fe000 + (off)))
 
+#ifdef CONFIG_DEBUG_FS
 static int __init pm_dbg_init(void);
+#endif
 
 void omap2_pm_dump(int mode, int resume, unsigned int us)
 {
arch/arm/mach-omap2/pm34xx.c +4 -0
index 7a1eb95..e3da0ab 100644
@@ -438,8 +438,10 @@ void omap_sram_idle(void)
 	    core_next_state == PWRDM_POWER_OFF)
 		sdrc_pwr = sdrc_read_reg(SDRC_POWER);
 
+#ifdef CONFIG_DEBUG_FS
 	if (regset_save_on_suspend)
 		pm_dbg_regset_save(1);
+#endif
 
 	/*
 	 * omap3_arm_context is the location where ARM registers
@@ -1218,7 +1220,9 @@ static void __init configure_vc(void)
 	prm_write_mod_reg(prm_setup.voltsetup2, OMAP3430_GR_MOD,
 			OMAP3_PRM_VOLTSETUP2_OFFSET);
 
+#ifdef CONFIG_DEBUG_FS
 	pm_dbg_regset_init(1);
+#endif
 }
 
 static int __init omap3_pm_early_init(void)
Signature · 1 line
1.6.2.2
#1 lore raw
Quoted 27 lines · Sanjeev Premi

Made a mistake of enabling PM_DEBUG without DEBUG_FS. This leads to compile time warnings and errors.

arch/arm/mach-omap2/pm-debug.c:56: warning: 'pm_dbg_init'
declared 'static' but never defined

arch/arm/mach-omap2/built-in.o: In function `omap_sram_idle':
arch/arm/mach-omap2/pm34xx.c:442: undefined reference to
'pm_dbg_regset_save'
arch/arm/mach-omap2/built-in.o: In function `configure_vc':
arch/arm/mach-omap2/pm34xx.c:1221: undefined reference to
'pm_dbg_regset_init'

Another alternate is to link these Kconfig options; but didn't seem intuitive.

---
 arch/arm/mach-omap2/pm-debug.c |    2 ++
 arch/arm/mach-omap2/pm34xx.c   |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/pm-debug.c +0 -0
index 1b4c160..175d461 100644

arch/arm/mach-omap2/pm-debug.c int omap2_pm_debug; · line 58

Quoted 6 lines
arch/arm/mach-omap2/pm-debug.c +2 -0
@@ -53,7 +53,9 @@ int omap2_pm_debug;
 	regs[reg_count].name = #reg; \
 	regs[reg_count++].val = __raw_readl(OMAP2_IO_ADDRESS(0x480fe000 + (off)))
 
+#ifdef CONFIG_DEBUG_FS
 static int __init pm_dbg_init(void);
+#endif

Move this into the other #ifdef CONFIG_DEBUG_FS later in the same file.

Quoted 7 lines
arch/arm/mach-omap2/pm-debug.c +0 -0
 void omap2_pm_dump(int mode, int resume, unsigned int us)
 {
arch/arm/mach-omap2/pm34xx.c +0 -0
index 7a1eb95..e3da0ab 100644

arch/arm/mach-omap2/pm34xx.c void omap_sram_idle(void) · line 444

Quoted 7 lines
arch/arm/mach-omap2/pm34xx.c +2 -0
@@ -438,8 +438,10 @@ void omap_sram_idle(void)
 	    core_next_state == PWRDM_POWER_OFF)
 		sdrc_pwr = sdrc_read_reg(SDRC_POWER);
 
+#ifdef CONFIG_DEBUG_FS
 	if (regset_save_on_suspend)
 		pm_dbg_regset_save(1);
+#endif

I don't like the #ifdefs here...

arch/arm/mach-omap2/pm34xx.c static void __init configure_vc(void) · line 1225

Quoted 10 lines
arch/arm/mach-omap2/pm34xx.c +2 -0
 	/*
 	 * omap3_arm_context is the location where ARM registers
@@ -1218,7 +1220,9 @@ static void __init configure_vc(void)
 	prm_write_mod_reg(prm_setup.voltsetup2, OMAP3430_GR_MOD,
 			OMAP3_PRM_VOLTSETUP2_OFFSET);
 
+#ifdef CONFIG_DEBUG_FS
 	pm_dbg_regset_init(1);
+#endif

or here.

how about just adding dummy functions in pm-debug.c like this (on top of your patch), then these #ifdefs can go away.

arch/arm/mach-omap2/pm-debug.c +2 -0
index 175d461..99855aa 100644
@@ -578,4 +578,6 @@ arch_initcall(pm_dbg_init);
 
 #else
 void pm_dbg_update_time(struct powerdomain *pwrdm, int prev) {}
+int pm_dbg_regset_save(int reg_set) { return 0; }
+int pm_dbg_regset_init(int reg_set) { return 0; }
 #endif