Re: [PATCH 08/30] ARM: omap2+: fix building without i2c

From: Paul Walmsley
Date: Sun Oct 02 2011 - 21:31:40 EST

Hello Arnd,

On Sun, 2 Oct 2011, Arnd Bergmann wrote:

> A trivial typo causes build breakage when I2C is disabled
> and omap_i2c_reset is set to NULL on OMAP:
> omap_hwmod_44xx_data.c:2287:11: error: lvalue required as unary '&' operand
> Removing the '&' character solves this.
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: Avinash.H.M <avinashhm@xxxxxx>
> Cc: Paul Walmsley <paul@xxxxxxxxx>

Nice catch. I think the bug is different, though. omap_i2c_reset should
never be NULL: that code is intended to execute even when
CONFIG_I2C_OMAP=n. The idea is to prevent the IP block from interfering
with the rest of the kernel even if the driver is not compiled in, no
matter how the bootloader or previous OS programmed the IP block.

I'd suggest something like the following patch instead.

- Paul

From: Paul Walmsley <paul@xxxxxxxxx>
Date: Sun, 2 Oct 2011 19:15:10 -0600
Subject: [PATCH] ARM: omap2+: fix build breakage when CONFIG_I2C_OMAP=n

arch/arm/mach-omap2/Makefile incorrectly skips compilation of the I2C
IP block reset code when CONFIG_I2C_OMAP=n. Fix by unconditionally
compiling arch/arm/mach-omap2/i2c.o, which is needed on all OMAP2+ platforms.

Problem noted by Arnd Bergmann <arnd@xxxxxxxx>.

Signed-off-by: Paul Walmsley <paul@xxxxxxxxx>
Cc: Avinash.H.M <avinashhm@xxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Tony Lindgren <tony@xxxxxxxxxxx>
arch/arm/mach-omap2/Makefile | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f343365..0951986 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -4,7 +4,7 @@

# Common support
obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer.o pm.o \
- common.o gpio.o dma.o wd_timer.o
+ common.o gpio.o dma.o wd_timer.o i2c.o

omap-2-3-common = irq.o sdrc.o
hwmod-common = omap_hwmod.o \
@@ -175,9 +175,6 @@ obj-$(CONFIG_OMAP_IOMMU) += iommu2.o
iommu-$(CONFIG_OMAP_IOMMU) := omap-iommu.o
obj-y += $(iommu-m) $(iommu-y)

-i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
-obj-y += $(i2c-omap-m) $(i2c-omap-y)
obj-y += dsp.o

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at