[PATCH v2 04/10] clocksource: mvebu: lookup clock by physbase

Sebastian Hesselbarth sebastian.hesselbarth at gmail.com
Tue Jul 2 14:30:43 EDT 2013


This converts Armada 370/XP SoC init to register tclk alias
for timer by physbase instead of name.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
---
Changelog:
v2:
- register timer clkdev by physbase (Suggested by Sascha Hauer)

Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Cc: barebox at lists.infradead.org
---
 arch/arm/mach-mvebu/armada-370-xp.c |    3 ++-
 drivers/clocksource/mvebu.c         |    3 +--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 1d64861..24720d5 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -91,7 +91,7 @@ static int armada_xp_init_clocks(void)
 {
 	/* On Armada XP, the TCLK frequency is always 250 Mhz */
 	tclk = clk_fixed("tclk", 250000000);
-	return clk_register_clkdev(tclk, NULL, "mvebu-timer");
+	return 0;
 }
 #define armada_370_xp_init_clocks()	armada_xp_init_clocks()
 #endif
@@ -101,6 +101,7 @@ static int armada_370_xp_init_soc(void)
 	unsigned long phys_base, phys_size;
 
 	armada_370_xp_init_clocks();
+	clkdev_add_physbase(tclk, (unsigned int)ARMADA_370_XP_TIMER_BASE, NULL);
 	add_generic_device("mvebu-timer", DEVICE_ID_SINGLE, NULL,
 			   (unsigned int)ARMADA_370_XP_TIMER_BASE, 0x30,
 			   IORESOURCE_MEM, NULL);
diff --git a/drivers/clocksource/mvebu.c b/drivers/clocksource/mvebu.c
index 8bedd99..6bd83f7 100644
--- a/drivers/clocksource/mvebu.c
+++ b/drivers/clocksource/mvebu.c
@@ -57,8 +57,7 @@ static int mvebu_timer_probe(struct device_d *dev)
 	u32 val;
 
 	timer_base = dev_request_mem_region(dev, 0);
-
-	tclk = clk_get(dev, "tclk");
+	tclk = clk_get(dev, NULL);
 
 	val = __raw_readl(timer_base + TIMER_CTRL_OFF);
 	val &= ~TIMER0_25MHZ;
-- 
1.7.2.5




More information about the barebox mailing list