diff mbox

[1/1] Allow I2C_OMAP to compile as a module.

Message ID ba2e7dbd53e76bb21bbb95fc026df11787cbd798.1234447641.git.ext-atal.shargorodsky@nokia.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Atal Shargorodsky Feb. 12, 2009, 2:10 p.m. UTC
This patch allows I2C_OMAP to be compiled as a module.
Only drivers/i2c/busses/i2c-omap.c can be compiled as a module,
but not arch/arm/plat-omap/i2c.c , so let the contents of i2c.c
to compile into the kernel if either I2C_OMAP was selected to compile in
or as a module.

Signed-off-by: Atal Shargorodsky <ext-atal.shargorodsky@nokia.com>
---
 arch/arm/plat-omap/Makefile |    3 +--
 arch/arm/plat-omap/i2c.c    |    4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Jarkko Nikula Feb. 13, 2009, 6:58 a.m. UTC | #1
On Thu, 12 Feb 2009 15:10:29 +0100
"Shargorodsky Atal (EXT-Teleca/Helsinki)"
<ext-atal.shargorodsky@nokia.com> wrote:

> This patch allows I2C_OMAP to be compiled as a module.
> Only drivers/i2c/busses/i2c-omap.c can be compiled as a module,
> but not arch/arm/plat-omap/i2c.c , so let the contents of i2c.c
> to compile into the kernel if either I2C_OMAP was selected to compile
> in or as a module.
> 
> Signed-off-by: Atal Shargorodsky <ext-atal.shargorodsky@nokia.com>
> ---
>  arch/arm/plat-omap/Makefile |    3 +--
>  arch/arm/plat-omap/i2c.c    |    4 ++++
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
Tony,

You can add this to your 2.6.29-rc series since the same build error is
in mainline as well if CONFIG_I2C_OMAP=m.

  Building modules, stage 2.
  GZIP    arch/arm/boot/compressed/piggy.gz
  MODPOST 6 modules
ERROR: "i2c_register_board_info" [arch/arm/plat-omap/i2c.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
make: *** Waiting for unfinished jobs....

Subject needs a "ARM: OMAP: " prefix, otherwise ok from me.

Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
--
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
diff mbox

Patch

diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index b3f0e6b..3617bfe 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -4,7 +4,7 @@ 
 
 # Common support
 obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \
-	 usb.o fb.o io.o
+	 usb.o fb.o io.o i2c.o
 obj-m :=
 obj-n :=
 obj-  :=
@@ -21,7 +21,6 @@  obj-$(CONFIG_OMAP_COMPONENT_VERSION) += component-version.o
 obj-$(CONFIG_OMAP_GPIO_SWITCH) += gpio-switch.o
 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
 obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
-obj-$(CONFIG_I2C_OMAP) += i2c.o
 
 # OMAP mailbox framework
 obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 467531e..a98a07f 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -35,6 +35,8 @@ 
 #define OMAP2_I2C_BASE2		0x48072000
 #define OMAP2_I2C_BASE3		0x48060000
 
+#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
+
 static const char name[] = "i2c_omap";
 
 #define I2C_RESOURCE_BUILDER(base, irq)			\
@@ -163,3 +165,5 @@  int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
 	omap_i2c_mux_pins(bus_id - 1);
 	return platform_device_register(pdev);
 }
+
+#endif