Commit 56c0c529 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: pxa: fix possible race condition

pxa_rtc_open() registers the interrupt handler which will access the RTC
registers. However, pxa_rtc_open() is called before the register range is
ioremapped. Instead, call it after devm_ioremap().
Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent be8e2746
...@@ -348,7 +348,7 @@ static int __init pxa_rtc_probe(struct platform_device *pdev) ...@@ -348,7 +348,7 @@ static int __init pxa_rtc_probe(struct platform_device *pdev)
dev_err(dev, "No alarm IRQ resource defined\n"); dev_err(dev, "No alarm IRQ resource defined\n");
return -ENXIO; return -ENXIO;
} }
pxa_rtc_open(dev);
pxa_rtc->base = devm_ioremap(dev, pxa_rtc->ress->start, pxa_rtc->base = devm_ioremap(dev, pxa_rtc->ress->start,
resource_size(pxa_rtc->ress)); resource_size(pxa_rtc->ress));
if (!pxa_rtc->base) { if (!pxa_rtc->base) {
...@@ -356,6 +356,8 @@ static int __init pxa_rtc_probe(struct platform_device *pdev) ...@@ -356,6 +356,8 @@ static int __init pxa_rtc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
pxa_rtc_open(dev);
sa1100_rtc->rcnr = pxa_rtc->base + 0x0; sa1100_rtc->rcnr = pxa_rtc->base + 0x0;
sa1100_rtc->rtsr = pxa_rtc->base + 0x8; sa1100_rtc->rtsr = pxa_rtc->base + 0x8;
sa1100_rtc->rtar = pxa_rtc->base + 0x4; sa1100_rtc->rtar = pxa_rtc->base + 0x4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment