From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: I2C device board info
Date: Sat, 18 Jul 2009 15:08:03 +0200 [thread overview]
Message-ID: <20090718150803.68fea223@hyperion.delvare> (raw)
In-Reply-To: <20090718105600.GA29887-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
Hi Russell,
On Sat, 18 Jul 2009 11:56:00 +0100, Russell King - ARM Linux wrote:
> Sascha,
>
> I've noticed the following in i2c_board_info initializers:
>
> arch/arm/mach-mx2/pcm038.c: I2C_BOARD_INFO("rtc-pcf8563", 0x51),
> arch/arm/mach-mx2/pcm038.c- .type = "pcf8563"
>
> However, I2C_BOARD_INFO is defined as:
>
> #define I2C_BOARD_INFO(dev_type, dev_addr) \
> .type = dev_type, .addr = (dev_addr)
>
> so you're initializing .type twice. Only one of these will be used,
> so you may want to correct these entries. (Looking at Realview, the
> one which is used is the second - so in the above case, .type will
> be initialized with current gcc to "pcf8563" not "rtc-pcf8563".)
Most probably for historical reasons - the initial implementation of
I2C_BOARD_INFO did define the driver name, and setting the device type
was optional. Apparently the above piece of code was forgotten when
I2C_BOARD_INFO() was modified.
The correct type name for this chip is "pcf8563" so the two lines above
should be turned into:
I2C_BOARD_INFO("pcf8563", 0x51),
Note that this is not an isolated case, although this one is worse
because I2C_BOARD_INFO() and .type do not agree on the chip name. But
there are several redundant .type definitions in arch/arm/mach-* and
one in arch/blackfin/mach-bf527. Time to fix them?
--
Jean Delvare
next prev parent reply other threads:[~2009-07-18 13:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-18 10:56 I2C device board info Russell King - ARM Linux
[not found] ` <20090718105600.GA29887-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-07-18 13:08 ` Jean Delvare [this message]
[not found] ` <20090718150803.68fea223-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-18 13:12 ` Russell King - ARM Linux
[not found] ` <20090718131237.GB4120-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-07-18 13:29 ` Jean Delvare
[not found] ` <20090718152918.09912dea-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-18 13:57 ` Russell King - ARM Linux
[not found] ` <20090718135713.GC4120-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2009-07-18 14:39 ` Jean Delvare
2009-07-18 15:45 ` Ben Dooks
2009-07-20 6:20 ` Sascha Hauer
[not found] ` <20090720062034.GV2714-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-07-20 7:34 ` 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=20090718150803.68fea223@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).