public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: b-cousson@ti•com (Cousson, Benoit)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 3/3] ARM: OMAP: I2C: fix compilation when !CONFIG_OF
Date: Sun, 22 Jan 2012 17:59:22 +0100	[thread overview]
Message-ID: <4F1C406A.6040503@ti.com> (raw)
In-Reply-To: <4F1C3412.4070106@gmail.com>

On 1/22/2012 5:06 PM, Rob Herring wrote:
> On 01/22/2012 09:45 AM, Grant Likely wrote:
>> On Sun, Jan 22, 2012 at 04:02:33AM -0700, Paul Walmsley wrote:
>>> Commit 6145197be6cc0583fa1a2f4ec1079d366137061e ("i2c: OMAP: Add DT
>>> support for i2c controller") breaks compilation when CONFIG_OF is not
>>> defined:
>>>
>>>    CC      drivers/i2c/busses/i2c-omap.o
>>> drivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe':
>>> drivers/i2c/busses/i2c-omap.c:1021:26: error: 'omap_i2c_of_match' undeclared (first use in this function)
>>> drivers/i2c/busses/i2c-omap.c:1021:26: note: each undeclared identifier is reported only once for each function it appears in
>>>
>>> Fix this by avoiding of_*() functions when !CONFIG_OF.
>>
>> To avoid #ifdef blocks, how about one of these fixes instead?
>> of_match_device resolves to a static inline NULL when CONFIG_OF is not
>> selected.
>>
>> g.
>>
>> ---
>> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
>> index f713eac..c22e51f 100644
>> --- a/drivers/i2c/busses/i2c-omap.c
>> +++ b/drivers/i2c/busses/i2c-omap.c
>> @@ -979,6 +979,8 @@ static const struct of_device_id omap_i2c_of_match[] = {
>>   	{ },
>>   };
>>   MODULE_DEVICE_TABLE(of, omap_i2c_of_match);
>> +#else
>> +#define omap_i2c_of_match NULL
>>   #endif
>
> Or just remove the existing ifdef. Isn't OMAP going to be completely
> converted to DT?
>
> I think building CONFIG_OF and !CONFIG_OF and running non-DT machines
> with OF enabled is going to be a constant source of breakage. We should
> move selecting CONFIG_OF up from boards/SOC config to family config
> (i.e. all OMAP).

Yep, I do agree, and even sent a patch for that.

http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-December/010541.html

But it looks like it was stuck in linux-omap dt branch and not pulled 
for 3.3. Maybe Tony can try to sent it during -rc phase.

That being said, this will be valid for OMAP2+ only and will still break 
OMAP1 platform :-(

Tony reported that 2 days ago, and I sent the fix for it.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg61520.html

It is now waiting for Ben's Acked-by.

Regards,
Benoit

  reply	other threads:[~2012-01-22 16:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-22 11:02 [PATCH 0/3] ARM: OMAP: fix compilation problems with v3.3-rc1 Paul Walmsley
2012-01-22 11:02 ` [PATCH 1/3] ARM: OMAP: PRM: fix missing plat/irqs.h build breakage Paul Walmsley
2012-01-22 11:02 ` [PATCH 2/3] ARM: OMAP2+: io: fix compilation breakage on 2420-only configs Paul Walmsley
2012-01-22 11:02 ` [PATCH 3/3] ARM: OMAP: I2C: fix compilation when !CONFIG_OF Paul Walmsley
2012-01-22 15:40   ` Rob Herring
2012-01-22 15:46     ` Grant Likely
2012-01-22 15:45   ` Grant Likely
2012-01-22 16:06     ` Rob Herring
2012-01-22 16:59       ` Cousson, Benoit [this message]
2012-01-22 19:54         ` Paul Walmsley
2012-01-22 20:07           ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1C406A.6040503@ti.com \
    --to=b-cousson@ti$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox