summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2014-07-01 11:33:17 +0200
committerNicolas Ferre <nicolas.ferre@atmel.com>2014-09-02 18:52:26 +0200
commita7d84d73b9ca32871da8fc05e95ca47c04fbb110 (patch)
treefced2429cb445d4c9954526e6065cfc3397f296b
parent2d7fdbe23c990a843177e3bff9a093d2f5fa4e02 (diff)
downloadop-kernel-dev-a7d84d73b9ca32871da8fc05e95ca47c04fbb110.zip
op-kernel-dev-a7d84d73b9ca32871da8fc05e95ca47c04fbb110.tar.gz
ARM: at91: PIT: Use of_have_populated_dt instead of CONFIG_OF
Until now, the machines, even when CONFIG_OF was enabled, were calling at91sam926x_ioremap_pit to try to map the PIT address using the defined physical address. Obviously, with DT, it's not appropriate anymore, and some code was added to the function to deal with this case. Unfortunately, this code was conditionned on CONFIG_OF, which can be enabled, even though no DT was actually used, which would result in such a case, to this code being executed, without any reason. Moreover, the logic that was here before to bail out of the function just check in the DT to see if the PIT node is there, which is the case in all our DTSI. All this can be made much more straightforward just by using of_have_populated_dt to bail out. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 2e6f1a3..b87a12f 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -279,15 +279,9 @@ void __init at91sam926x_pit_init(void)
void __init at91sam926x_ioremap_pit(u32 addr)
{
-#if defined(CONFIG_OF)
- struct device_node *np =
- of_find_matching_node(NULL, pit_timer_ids);
-
- if (np) {
- of_node_put(np);
+ if (of_have_populated_dt())
return;
- }
-#endif
+
pit_base_addr = ioremap(addr, 16);
if (!pit_base_addr)
OpenPOWER on IntegriCloud