All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: I2C device board info
Date: Mon, 20 Jul 2009 08:20:34 +0200	[thread overview]
Message-ID: <20090720062034.GV2714@pengutronix.de> (raw)
In-Reply-To: <20090718105600.GA29887-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>

On Sat, Jul 18, 2009 at 11:56:00AM +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".)
> 

Ok, here we go:

>From 89b5958a911ddcf1079e0dd6bbf2287f04c358d9 Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Date: Mon, 20 Jul 2009 08:18:47 +0200
Subject: [PATCH] ARM: mxc: Fix i2c_board_info definitions

Fix i2c_board_info definitions - we were defining the 'type' field
of these structures twice since the first argument of I2C_BOARD_INFO
sets this field.  Move the second definition into I2C_BOARD_INFO().

Signed-off-by: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 arch/arm/mach-mx1/mx1ads.c          |    6 ++----
 arch/arm/mach-mx2/eukrea_cpuimx27.c |    3 +--
 arch/arm/mach-mx2/pcm038.c          |   12 ++++--------
 arch/arm/mach-mx3/pcm037.c          |    3 +--
 arch/arm/mach-mx3/pcm043.c          |    3 +--
 5 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mx1ads.c
index 6af064d..30f04e5 100644
--- a/arch/arm/mach-mx1/mx1ads.c
+++ b/arch/arm/mach-mx1/mx1ads.c
@@ -104,12 +104,10 @@ static struct imxi2c_platform_data mx1ads_i2c_data = {
 
 static struct i2c_board_info mx1ads_i2c_devices[] = {
 	{
-		I2C_BOARD_INFO("pcf857x", 0x22),
-		.type = "pcf8575",
+		I2C_BOARD_INFO("pcf8575", 0x22),
 		.platform_data = &pcf857x_data[0],
 	}, {
-		I2C_BOARD_INFO("pcf857x", 0x24),
-		.type = "pcf8575",
+		I2C_BOARD_INFO("pcf8575", 0x24),
 		.platform_data = &pcf857x_data[1],
 	},
 };
diff --git a/arch/arm/mach-mx2/eukrea_cpuimx27.c b/arch/arm/mach-mx2/eukrea_cpuimx27.c
index a2c4181..7b18760 100644
--- a/arch/arm/mach-mx2/eukrea_cpuimx27.c
+++ b/arch/arm/mach-mx2/eukrea_cpuimx27.c
@@ -135,8 +135,7 @@ static struct imxi2c_platform_data eukrea_cpuimx27_i2c_1_data = {
 
 static struct i2c_board_info eukrea_cpuimx27_i2c_devices[] = {
 	{
-		I2C_BOARD_INFO("rtc-pcf8563", 0x51),
-		.type = "pcf8563"
+		I2C_BOARD_INFO("pcf8563", 0x51),
 	},
 };
 
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/pcm038.c
index 638d078..9a3483c 100644
--- a/arch/arm/mach-mx2/pcm038.c
+++ b/arch/arm/mach-mx2/pcm038.c
@@ -186,17 +186,13 @@ static struct at24_platform_data board_eeprom = {
 };
 
 static struct i2c_board_info pcm038_i2c_devices[] = {
-	[0] = {
+	{
 		I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
 		.platform_data = &board_eeprom,
-	},
-	[1] = {
-		I2C_BOARD_INFO("rtc-pcf8563", 0x51),
-		.type = "pcf8563"
-	},
-	[2] = {
+	}, {
+		I2C_BOARD_INFO("pcf8563", 0x51),
+	}, {
 		I2C_BOARD_INFO("lm75", 0x4a),
-		.type = "lm75"
 	}
 };
 
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index 6a3a1a9..d307887 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -266,8 +266,7 @@ static struct i2c_board_info pcm037_i2c_devices[] = {
 		I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
 		.platform_data = &board_eeprom,
 	}, {
-		I2C_BOARD_INFO("rtc-pcf8563", 0x51),
-		.type = "pcf8563",
+		I2C_BOARD_INFO("pcf8563", 0x51),
 	}
 };
 #endif
diff --git a/arch/arm/mach-mx3/pcm043.c b/arch/arm/mach-mx3/pcm043.c
index 7c7d3cc..e43276e 100644
--- a/arch/arm/mach-mx3/pcm043.c
+++ b/arch/arm/mach-mx3/pcm043.c
@@ -133,8 +133,7 @@ static struct i2c_board_info pcm043_i2c_devices[] = {
 		I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
 		.platform_data = &board_eeprom,
 	}, {
-		I2C_BOARD_INFO("rtc-pcf8563", 0x51),
-		.type = "pcf8563",
+		I2C_BOARD_INFO("pcf8563", 0x51),
 	}
 };
 #endif
-- 
1.6.3.3

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  parent reply	other threads:[~2009-07-20  6:20 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
     [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 [this message]
     [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=20090720062034.GV2714@pengutronix.de \
    --to=s.hauer-bicnvbalz9megne8c9+irq@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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.