All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] Error when compiling without CONFIG_PM_DEBUG
@ 2010-10-01 12:46 GERBER Patrick
  2010-10-01 15:15 ` Kevin Hilman
  0 siblings, 1 reply; 2+ messages in thread
From: GERBER Patrick @ 2010-10-01 12:46 UTC (permalink / raw)
  To: linux-omap@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

Hello all,

I have compiled a fresh clone of the linux-omap-2.6 kernel for overo and I have linker error.

The serial.c and pm34xx.c files used some variables declared as extern. The real declaration of those variables are on pm-debug.c and are compiled only with CONFIG_PM_DEBUG.
So I have added some #ifdef to correct the error. I don't know if it's the best idea but anyway with the attached patch it's work.

Patrick

[-- Attachment #2: pm_debug.patch --]
[-- Type: application/octet-stream, Size: 1102 bytes --]

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index d2b940c..a4344e8d 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -476,8 +476,10 @@ void omap_sram_idle(void)
 
 int omap3_can_sleep(void)
 {
+#ifdef CONFIG_PM_DEBUG
 	if (!sleep_while_idle)
 		return 0;
+#endif
 	if (!omap_uart_can_sleep())
 		return 0;
 	return 1;
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 566e991..770fbf1 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -226,8 +226,10 @@ static void omap_uart_save_context(struct omap_uart_state *uart)
 	u16 lcr = 0;
 	struct plat_serial8250_port *p = uart->p;
 
+#ifdef CONFIG_PM_DEBUG
 	if (!enable_off_mode)
 		return;
+#endif
 
 	lcr = serial_read_reg(p, UART_LCR);
 	serial_write_reg(p, UART_LCR, 0xBF);
@@ -250,8 +252,10 @@ static void omap_uart_restore_context(struct omap_uart_state *uart)
 	u16 efr = 0;
 	struct plat_serial8250_port *p = uart->p;
 
+#ifdef CONFIG_PM_DEBUG
 	if (!enable_off_mode)
 		return;
+#endif
 
 	if (!uart->context_valid)
 		return;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] Error when compiling without CONFIG_PM_DEBUG
  2010-10-01 12:46 [Patch] Error when compiling without CONFIG_PM_DEBUG GERBER Patrick
@ 2010-10-01 15:15 ` Kevin Hilman
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hilman @ 2010-10-01 15:15 UTC (permalink / raw)
  To: GERBER Patrick; +Cc: linux-omap@vger.kernel.org

GERBER Patrick <Patrick.Gerber@heig-vd.ch> writes:

> Hello all,
>
> I have compiled a fresh clone of the linux-omap-2.6 kernel for overo and I have linker error.
>
> The serial.c and pm34xx.c files used some variables declared as
> extern. The real declaration of those variables are on pm-debug.c and
> are compiled only with CONFIG_PM_DEBUG.  

Hi Patric, thanks for the patch.

A couple days ago, a similar patch was posted by Loïc Minier to fix the
same issue, and I'm waiting an updated version of his patch.

> So I have added some #ifdef to correct the error. I don't know if it's
> the best idea but anyway with the attached patch it's work.

Adding #ifdefs in this way is generally not done in the kernel.  For
another example of how to solve the same problem, see the patch from
Loïc.  Also see the '#ifdefs are ugly' section of
Documentation/SubmittingPatches in the kernel source.

Thanks again for contributing your fixes back,

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-01 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-01 12:46 [Patch] Error when compiling without CONFIG_PM_DEBUG GERBER Patrick
2010-10-01 15:15 ` Kevin Hilman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.