diff mbox

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

Message ID 20090213222100.GJ7562@atomide.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Tony Lindgren Feb. 13, 2009, 10:21 p.m. UTC
* Jarkko Nikula <jarkko.nikula@nokia.com> [090212 22:58]:
> 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>

Sounds like a fix, except I posted a shorter version of the patch that
should do the trick (untested). Attached here too for reference.

Tony

Comments

Jarkko Nikula Feb. 15, 2009, 7:35 p.m. UTC | #1
On Fri, 13 Feb 2009 14:21:00 -0800
Tony Lindgren <tony@atomide.com> wrote:

> > Subject needs a "ARM: OMAP: " prefix, otherwise ok from me.
> > 
> > Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
> 
> Sounds like a fix, except I posted a shorter version of the patch that
> should do the trick (untested). Attached here too for reference.
> 
Tony's version does not fix the issue since obj-$(CONFIG_I2C_OMAP) below
still tries to compile arch/arm/plat-omap/i2c.c as a module.

-obj-$(CONFIG_I2C_OMAP) += i2c.o
+
+ifneq ($(CONFIG_I2C_OMAP),)
+	obj-$(CONFIG_I2C_OMAP)		+= i2c.o
+endif

Problem was that drivers/i2c/busses/i2c-omap.c can be module but
arch/arm/plat-omap/i2c.c cannot since it is for early board
initialization code.
Jarkko Nikula Feb. 15, 2009, 7:45 p.m. UTC | #2
On Sun, 15 Feb 2009 21:35:59 +0200
Jarkko Nikula <jhnikula@gmail.com> wrote:

> Tony's version does not fix the issue since obj-$(CONFIG_I2C_OMAP)
> below still tries to compile arch/arm/plat-omap/i2c.c as a module.
> 
> -obj-$(CONFIG_I2C_OMAP) += i2c.o
> +
> +ifneq ($(CONFIG_I2C_OMAP),)
> +	obj-$(CONFIG_I2C_OMAP)		+= i2c.o
> +endif
> 
And build works if obj-y rule is used instead

-obj-$(CONFIG_I2C_OMAP) += i2c.o
+
+ifneq ($(CONFIG_I2C_OMAP),)
+	obj-y	+= i2c.o
+endif

Good. Patch can be made to touch only single file and add only three new
lines.
Felipe Balbi Feb. 15, 2009, 8:47 p.m. UTC | #3
Hi,

On Sun, 15 Feb 2009 21:35:59 +0200, Jarkko Nikula <jhnikula@gmail.com>
wrote:
> On Fri, 13 Feb 2009 14:21:00 -0800
> Tony Lindgren <tony@atomide.com> wrote:
> 
>> > Subject needs a "ARM: OMAP: " prefix, otherwise ok from me.
>> >
>> > Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
>>
>> Sounds like a fix, except I posted a shorter version of the patch that
>> should do the trick (untested). Attached here too for reference.
>>
> Tony's version does not fix the issue since obj-$(CONFIG_I2C_OMAP) below
> still tries to compile arch/arm/plat-omap/i2c.c as a module.
> 
> -obj-$(CONFIG_I2C_OMAP) += i2c.o
> +
> +ifneq ($(CONFIG_I2C_OMAP),)
> +	obj-$(CONFIG_I2C_OMAP)		+= i2c.o
> +endif
> 
> Problem was that drivers/i2c/busses/i2c-omap.c can be module but
> arch/arm/plat-omap/i2c.c cannot since it is for early board
> initialization code.

why don't you:

-obj-$(CONFIG_I2C_OMAP) += i2c.o
+obj-y			+= i2c.o

It's quite possible that we will need i2c
anyways in most boards. And for the ones who
won't need, it's just a few extra bytes
to kernel image. I guess it should be
ok to always build i2c utilities.
Koskinen, Aaro (Nokia - FI/Espoo) Feb. 16, 2009, 4:40 p.m. UTC | #4
Hello,

ext Jarkko Nikula wrote:
> Jarkko Nikula <jhnikula@gmail.com> wrote:
>> Tony's version does not fix the issue since obj-$(CONFIG_I2C_OMAP)
>> below still tries to compile arch/arm/plat-omap/i2c.c as a module.
>>
>> -obj-$(CONFIG_I2C_OMAP) += i2c.o
>> +
>> +ifneq ($(CONFIG_I2C_OMAP),)
>> +     obj-$(CONFIG_I2C_OMAP)          += i2c.o
>> +endif
>>
> And build works if obj-y rule is used instead
> 
> -obj-$(CONFIG_I2C_OMAP) += i2c.o
> +
> +ifneq ($(CONFIG_I2C_OMAP),)
> +       obj-y   += i2c.o
> +endif
> 
> Good. Patch can be made to touch only single file and add only three new
> lines.

Taking example from fs/Makefile (nfsd):

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

Also arch/arm/plat-omap/include/mach/common.h should be updated to check 
for CONFIG_I2C_OMAP_MODULE.

A.
--
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
Tony Lindgren Feb. 16, 2009, 11:09 p.m. UTC | #5
* Jarkko Nikula <jhnikula@gmail.com> [090215 11:44]:
> On Sun, 15 Feb 2009 21:35:59 +0200
> Jarkko Nikula <jhnikula@gmail.com> wrote:
> 
> > Tony's version does not fix the issue since obj-$(CONFIG_I2C_OMAP)
> > below still tries to compile arch/arm/plat-omap/i2c.c as a module.
> > 
> > -obj-$(CONFIG_I2C_OMAP) += i2c.o
> > +
> > +ifneq ($(CONFIG_I2C_OMAP),)
> > +	obj-$(CONFIG_I2C_OMAP)		+= i2c.o
> > +endif
> > 
> And build works if obj-y rule is used instead
> 
> -obj-$(CONFIG_I2C_OMAP) += i2c.o
> +
> +ifneq ($(CONFIG_I2C_OMAP),)
> +	obj-y	+= i2c.o
> +endif
> 
> Good. Patch can be made to touch only single file and add only three new
> lines.

Ah sorry for the typo :)

Tony
--
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
Tony Lindgren Feb. 16, 2009, 11:09 p.m. UTC | #6
* Aaro Koskinen <aaro.koskinen@nokia.com> [090216 08:40]:
> Hello,
>
> ext Jarkko Nikula wrote:
>> Jarkko Nikula <jhnikula@gmail.com> wrote:
>>> Tony's version does not fix the issue since obj-$(CONFIG_I2C_OMAP)
>>> below still tries to compile arch/arm/plat-omap/i2c.c as a module.
>>>
>>> -obj-$(CONFIG_I2C_OMAP) += i2c.o
>>> +
>>> +ifneq ($(CONFIG_I2C_OMAP),)
>>> +     obj-$(CONFIG_I2C_OMAP)          += i2c.o
>>> +endif
>>>
>> And build works if obj-y rule is used instead
>>
>> -obj-$(CONFIG_I2C_OMAP) += i2c.o
>> +
>> +ifneq ($(CONFIG_I2C_OMAP),)
>> +       obj-y   += i2c.o
>> +endif
>>
>> Good. Patch can be made to touch only single file and add only three new
>> lines.
>
> Taking example from fs/Makefile (nfsd):
>
> -obj-$(CONFIG_I2C_OMAP) += i2c.o
> +i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
> +obj-y += $(i2c-omap-m) $(i2c-omap-y)
>
> Also arch/arm/plat-omap/include/mach/common.h should be updated to check  
> for CONFIG_I2C_OMAP_MODULE.

That seems cleaner to me.

Tony
--
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
Jarkko Nikula Feb. 17, 2009, 9:25 a.m. UTC | #7
On Mon, 16 Feb 2009 18:40:12 +0200
Aaro Koskinen <aaro.koskinen@nokia.com> wrote:

> Taking example from fs/Makefile (nfsd):
> 
> -obj-$(CONFIG_I2C_OMAP) += i2c.o
> +i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
> +obj-y += $(i2c-omap-m) $(i2c-omap-y)
> 
This is getting shorter and shorter :-)

> Also arch/arm/plat-omap/include/mach/common.h should be updated to
> check for CONFIG_I2C_OMAP_MODULE.
> 
Good catch, that's true!


Jarkko
--
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
Tony Lindgren Feb. 17, 2009, 11:50 p.m. UTC | #8
* Jarkko Nikula <jhnikula@gmail.com> [090217 01:22]:
> On Mon, 16 Feb 2009 18:40:12 +0200
> Aaro Koskinen <aaro.koskinen@nokia.com> wrote:
> 
> > Taking example from fs/Makefile (nfsd):
> > 
> > -obj-$(CONFIG_I2C_OMAP) += i2c.o
> > +i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
> > +obj-y += $(i2c-omap-m) $(i2c-omap-y)
> > 
> This is getting shorter and shorter :-)
> 
> > Also arch/arm/plat-omap/include/mach/common.h should be updated to
> > check for CONFIG_I2C_OMAP_MODULE.
> > 
> Good catch, that's true!

Aaro, can you please send a proper patch with Signed-off-by and I'll
add it to omap-fixes?

Thanks

Tony
--
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
Otto Solares Feb. 17, 2009, 11:59 p.m. UTC | #9
On Tue, Feb 17, 2009 at 03:50:18PM -0800, Tony Lindgren wrote:
> Aaro, can you please send a proper patch with Signed-off-by and I'll
> add it to omap-fixes?

Tony: what's the purpose of omap-fixes and the difference between
master and omap-2.6.28? if I want a "stable" kernel which branch
should I use?

Thanks.

-otto
--
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
Tony Lindgren Feb. 18, 2009, 12:07 a.m. UTC | #10
* Otto Solares <solca@guug.org> [090217 16:00]:
> On Tue, Feb 17, 2009 at 03:50:18PM -0800, Tony Lindgren wrote:
> > Aaro, can you please send a proper patch with Signed-off-by and I'll
> > add it to omap-fixes?
> 
> Tony: what's the purpose of omap-fixes and the difference between
> master and omap-2.6.28? if I want a "stable" kernel which branch
> should I use?

Here's the quick rundown:

- master branch is current linux-omap against recent mainline kernel

- omap-fixes is the branch for fixes going to mainline during -rc cycle

- omap-upstream is a branch of generic omap patches going to mainline
  during the next merge window

- omap1-upstream is a branch of omap1 patches going to mainline during
  the next merge cycle

- omap2-upstream is a branch of omap2 patches going to mainline during
  the next merge cycle

- omap3-upstream is a branch of omap3 patches going to mainline during
  the next merge cycle

- omap-next branch is what gets pulled into linux-next and gets merged
  to the mainline the next merge window

The omap-2.6.28 branch is there because there were few bugs and I
thought we might want to tag v2.6.28-omap2. Mostly getting the MMC
working for omap1 as far as I remember.

For "stable" you should use the whatever omap tag we have against the
recent mainline kernel, so yeah, it would be the omap-2.6.28 branch
right now.

Regards,

Tony
--
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

--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -21,7 +21,10 @@  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
+
+ifneq ($(CONFIG_I2C_OMAP),)
+	obj-$(CONFIG_I2C_OMAP)		+= i2c.o
+endif
 
 # OMAP mailbox framework
 obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o