All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/6 v2] ARM: shmobile: r8a7778: cleanup registration of i2c
@ 2013-07-26  7:35 Kuninori Morimoto
  2013-07-26 13:37 ` Sergei Shtylyov
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Kuninori Morimoto @ 2013-07-26  7:35 UTC (permalink / raw)
  To: linux-sh

i2c-rcar driver which doesn't need platform data at the time of
registration can be registerd on SoC.
And, registering these drivers in the SoC code can avoid
unwanted device numbering issue.
(ex. the i2c3 device number will be i2c.0 if i2c3 only registered)
This patch registers it on SoC code as cleanup C code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2
 - based on renesas-devel-20130726
 - update git log

 arch/arm/mach-shmobile/board-bockw.c          |    1 -
 arch/arm/mach-shmobile/include/mach/r8a7778.h |    1 -
 arch/arm/mach-shmobile/setup-r8a7778.c        |    6 +++++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index 1c876ab..d7d3427 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -200,7 +200,6 @@ static void __init bockw_init(void)
 	r8a7778_init_irq_extpin(1);
 	r8a7778_add_standard_devices();
 	r8a7778_add_ether_device(&ether_platform_data);
-	r8a7778_add_i2c_device(0);
 	r8a7778_add_hspi_device(0);
 
 	i2c_register_board_info(0, i2c0_devices,
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
index aaa0544..9874511 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7778.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -23,7 +23,6 @@
 extern void r8a7778_add_standard_devices(void);
 extern void r8a7778_add_standard_devices_dt(void);
 extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
-extern void r8a7778_add_i2c_device(int id);
 extern void r8a7778_add_hspi_device(int id);
 extern void r8a7778_add_dt_devices(void);
 
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index c585ee0..e975fcc1 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -250,7 +250,7 @@ static struct resource i2c_resources[] __initdata = {
 	DEFINE_RES_IRQ(gic_iid(0x6d)),
 };
 
-void __init r8a7778_add_i2c_device(int id)
+static void __init r8a7778_register_i2c(int id)
 {
 	BUG_ON(id < 0 || id > 3);
 
@@ -303,6 +303,10 @@ void __init r8a7778_add_dt_devices(void)
 
 	r8a7778_register_tmu(0);
 	r8a7778_register_tmu(1);
+	r8a7778_register_i2c(0);
+	r8a7778_register_i2c(1);
+	r8a7778_register_i2c(2);
+	r8a7778_register_i2c(3);
 }
 
 void __init r8a7778_add_standard_devices(void)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-07-30  7:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-26  7:35 [PATCH 4/6 v2] ARM: shmobile: r8a7778: cleanup registration of i2c Kuninori Morimoto
2013-07-26 13:37 ` Sergei Shtylyov
2013-07-29  0:36 ` Kuninori Morimoto
2013-07-29 12:40 ` Sergei Shtylyov
2013-07-30  0:24 ` Kuninori Morimoto
2013-07-30  2:35 ` Simon Horman
2013-07-30  3:09 ` Kuninori Morimoto
2013-07-30  4:34 ` Simon Horman
2013-07-30  4:54 ` Kuninori Morimoto
2013-07-30  5:29 ` Simon Horman
2013-07-30  5:32 ` Kuninori Morimoto
2013-07-30  7:01 ` Kuninori Morimoto

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.