diff options
author | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-08-21 11:57:42 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-08-24 05:03:34 -0400 |
commit | 56c0c529848c853bc1049e271975917e8c9f4389 (patch) | |
tree | 2dcefa0bf475eb1986c9c08c18a9da60c6df2335 | |
parent | be8e2746462b11e92a882e45317fafcd2c0dc50b (diff) |
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: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r-- | drivers/rtc/rtc-pxa.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-pxa.c b/drivers/rtc/rtc-pxa.c index fe4985b54608..47304f5664d8 100644 --- a/drivers/rtc/rtc-pxa.c +++ b/drivers/rtc/rtc-pxa.c | |||
@@ -348,7 +348,7 @@ static int __init pxa_rtc_probe(struct platform_device *pdev) | |||
348 | dev_err(dev, "No alarm IRQ resource defined\n"); | 348 | dev_err(dev, "No alarm IRQ resource defined\n"); |
349 | return -ENXIO; | 349 | return -ENXIO; |
350 | } | 350 | } |
351 | pxa_rtc_open(dev); | 351 | |
352 | pxa_rtc->base = devm_ioremap(dev, pxa_rtc->ress->start, | 352 | pxa_rtc->base = devm_ioremap(dev, pxa_rtc->ress->start, |
353 | resource_size(pxa_rtc->ress)); | 353 | resource_size(pxa_rtc->ress)); |
354 | if (!pxa_rtc->base) { | 354 | if (!pxa_rtc->base) { |
@@ -356,6 +356,8 @@ static int __init pxa_rtc_probe(struct platform_device *pdev) | |||
356 | return -ENOMEM; | 356 | return -ENOMEM; |
357 | } | 357 | } |
358 | 358 | ||
359 | pxa_rtc_open(dev); | ||
360 | |||
359 | sa1100_rtc->rcnr = pxa_rtc->base + 0x0; | 361 | sa1100_rtc->rcnr = pxa_rtc->base + 0x0; |
360 | sa1100_rtc->rtsr = pxa_rtc->base + 0x8; | 362 | sa1100_rtc->rtsr = pxa_rtc->base + 0x8; |
361 | sa1100_rtc->rtar = pxa_rtc->base + 0x4; | 363 | sa1100_rtc->rtar = pxa_rtc->base + 0x4; |