mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Teresa Gámez" <t.gamez@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] ARCH: OMAP: Apply i2c-omap id_tables to device register functions
Date: Fri, 21 Jun 2013 14:50:19 +0200	[thread overview]
Message-ID: <1371819019-13596-2-git-send-email-t.gamez@phytec.de> (raw)
In-Reply-To: <1371819019-13596-1-git-send-email-t.gamez@phytec.de>

Remove omap_add_i2c() and use the id_table names to register the
devices.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/mach-omap/include/mach/am33xx-devices.h |    9 ++++++---
 arch/arm/mach-omap/include/mach/devices.h        |    2 --
 arch/arm/mach-omap/include/mach/omap3-devices.h  |    9 ++++++---
 arch/arm/mach-omap/include/mach/omap4-devices.h  |   12 ++++++++----
 arch/arm/mach-omap/omap_devices.c                |    6 ------
 5 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-omap/include/mach/am33xx-devices.h b/arch/arm/mach-omap/include/mach/am33xx-devices.h
index 822caab..6a4d901 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-devices.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-devices.h
@@ -55,17 +55,20 @@ static inline struct device_d *am33xx_add_spi1(void)
 
 static inline struct device_d *am33xx_add_i2c0(void *pdata)
 {
-	return omap_add_i2c(0, AM33XX_I2C0_BASE, pdata);
+	return add_generic_device("i2c-am33xx", 0, NULL, AM33XX_I2C0_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *am33xx_add_i2c1(void *pdata)
 {
-	return omap_add_i2c(1, AM33XX_I2C1_BASE, pdata);
+	return add_generic_device("i2c-am33xx", 1, NULL, AM33XX_I2C1_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *am33xx_add_i2c2(void *pdata)
 {
-	return omap_add_i2c(2, AM33XX_I2C2_BASE, pdata);
+	return add_generic_device("i2c-am33xx", 2, NULL, AM33XX_I2C2_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 #endif /* __MACH_OMAP3_DEVICES_H */
diff --git a/arch/arm/mach-omap/include/mach/devices.h b/arch/arm/mach-omap/include/mach/devices.h
index adae01b..537213f 100644
--- a/arch/arm/mach-omap/include/mach/devices.h
+++ b/arch/arm/mach-omap/include/mach/devices.h
@@ -9,6 +9,4 @@ void omap_add_sram0(resource_size_t base, resource_size_t size);
 
 struct device_d *omap_add_uart(int id, unsigned long base);
 
-struct device_d *omap_add_i2c(int id, unsigned long base, void *pdata);
-
 #endif /* __MACH_OMAP_DEVICES_H */
diff --git a/arch/arm/mach-omap/include/mach/omap3-devices.h b/arch/arm/mach-omap/include/mach/omap3-devices.h
index de67ea0..0809e95 100644
--- a/arch/arm/mach-omap/include/mach/omap3-devices.h
+++ b/arch/arm/mach-omap/include/mach/omap3-devices.h
@@ -77,17 +77,20 @@ static inline struct device_d *omap3_add_mmc3(struct omap_hsmmc_platform_data *p
 
 static inline struct device_d *omap3_add_i2c1(void *pdata)
 {
-	return omap_add_i2c(0, OMAP3_I2C1_BASE, pdata);
+	return add_generic_device("i2c-omap3", 0, NULL, OMAP3_I2C1_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *omap3_add_i2c2(void *pdata)
 {
-	return omap_add_i2c(1, OMAP3_I2C2_BASE, pdata);
+	return add_generic_device("i2c-omap3", 1, NULL, OMAP3_I2C2_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *omap3_add_i2c3(void *pdata)
 {
-	return omap_add_i2c(2, OMAP3_I2C3_BASE, pdata);
+	return add_generic_device("i2c-omap3", 2, NULL, OMAP3_I2C3_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *omap3_add_ehci(void *pdata)
diff --git a/arch/arm/mach-omap/include/mach/omap4-devices.h b/arch/arm/mach-omap/include/mach/omap4-devices.h
index 561d9ce..76c9789 100644
--- a/arch/arm/mach-omap/include/mach/omap4-devices.h
+++ b/arch/arm/mach-omap/include/mach/omap4-devices.h
@@ -60,22 +60,26 @@ static inline struct device_d *omap44xx_add_mmc5(struct omap_hsmmc_platform_data
 
 static inline struct device_d *omap44xx_add_i2c1(void *pdata)
 {
-	return omap_add_i2c(0, OMAP44XX_I2C1_BASE, pdata);
+	return add_generic_device("i2c-omap4", 0, NULL, OMAP44XX_I2C1_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *omap44xx_add_i2c2(void *pdata)
 {
-	return omap_add_i2c(1, OMAP44XX_I2C2_BASE, pdata);
+	return add_generic_device("i2c-omap4", 1, NULL, OMAP44XX_I2C2_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *omap44xx_add_i2c3(void *pdata)
 {
-	return omap_add_i2c(2, OMAP44XX_I2C3_BASE, pdata);
+	return add_generic_device("i2c-omap4", 2, NULL, OMAP44XX_I2C3_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *omap44xx_add_i2c4(void *pdata)
 {
-	return omap_add_i2c(3, OMAP44XX_I2C4_BASE, pdata);
+	return add_generic_device("i2c-omap4", 3, NULL, OMAP44XX_I2C4_BASE,
+			SZ_4K, IORESOURCE_MEM, pdata);
 }
 
 static inline struct device_d *omap44xx_add_ehci(void *pdata)
diff --git a/arch/arm/mach-omap/omap_devices.c b/arch/arm/mach-omap/omap_devices.c
index 056cba5..30cfdd0 100644
--- a/arch/arm/mach-omap/omap_devices.c
+++ b/arch/arm/mach-omap/omap_devices.c
@@ -24,9 +24,3 @@ struct device_d *omap_add_uart(int id, unsigned long base)
 	return add_ns16550_device(id, base, 1024,
 			IORESOURCE_MEM_8BIT, &serial_plat);
 }
-
-struct device_d *omap_add_i2c(int id, unsigned long base, void *pdata)
-{
-	return add_generic_device("i2c-omap", id, NULL, base, SZ_4K,
-			   IORESOURCE_MEM, pdata);
-}
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-06-21 12:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21 12:50 [PATCH 1/2] i2c-omap: Remove cpu_is functions completely Teresa Gámez
2013-06-21 12:50 ` Teresa Gámez [this message]
2013-06-23 18:37 ` Sascha Hauer

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=1371819019-13596-2-git-send-email-t.gamez@phytec.de \
    --to=t.gamez@phytec.de \
    --cc=barebox@lists.infradead.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