aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGuo Zeng <guo.zeng@csr.com>2014-12-10 18:52:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 20:41:13 -0500
commit0e95325525c4383565cea4f402f15a3113162d05 (patch)
treec1d6c26da1f234ce1c21738b11a1b6d8fb166970 /drivers/rtc
parenta682e9c28cac152e6e54c39efcf046e0c8cfcf63 (diff)
drivers/rtc/rtc-sirfsoc.c: move hardware initilization earlier in probe
Move rtc register to be later than hardware initialization. The reason is that devm_rtc_device_register() will do read_time() which is a callback accessing hardware. This sometimes causes a hang in the hardware related callback. Signed-off-by: Guo Zeng <guo.zeng@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-sirfsoc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c
index 76e38007ba90..24ba97d3286e 100644
--- a/drivers/rtc/rtc-sirfsoc.c
+++ b/drivers/rtc/rtc-sirfsoc.c
@@ -286,14 +286,6 @@ static int sirfsoc_rtc_probe(struct platform_device *pdev)
286 rtc_div = ((32768 / RTC_HZ) / 2) - 1; 286 rtc_div = ((32768 / RTC_HZ) / 2) - 1;
287 sirfsoc_rtc_iobrg_writel(rtc_div, rtcdrv->rtc_base + RTC_DIV); 287 sirfsoc_rtc_iobrg_writel(rtc_div, rtcdrv->rtc_base + RTC_DIV);
288 288
289 rtcdrv->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
290 &sirfsoc_rtc_ops, THIS_MODULE);
291 if (IS_ERR(rtcdrv->rtc)) {
292 err = PTR_ERR(rtcdrv->rtc);
293 dev_err(&pdev->dev, "can't register RTC device\n");
294 return err;
295 }
296
297 /* 0x3 -> RTC_CLK */ 289 /* 0x3 -> RTC_CLK */
298 sirfsoc_rtc_iobrg_writel(SIRFSOC_RTC_CLK, 290 sirfsoc_rtc_iobrg_writel(SIRFSOC_RTC_CLK,
299 rtcdrv->rtc_base + RTC_CLOCK_SWITCH); 291 rtcdrv->rtc_base + RTC_CLOCK_SWITCH);
@@ -308,6 +300,14 @@ static int sirfsoc_rtc_probe(struct platform_device *pdev)
308 rtcdrv->overflow_rtc = 300 rtcdrv->overflow_rtc =
309 sirfsoc_rtc_iobrg_readl(rtcdrv->rtc_base + RTC_SW_VALUE); 301 sirfsoc_rtc_iobrg_readl(rtcdrv->rtc_base + RTC_SW_VALUE);
310 302
303 rtcdrv->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
304 &sirfsoc_rtc_ops, THIS_MODULE);
305 if (IS_ERR(rtcdrv->rtc)) {
306 err = PTR_ERR(rtcdrv->rtc);
307 dev_err(&pdev->dev, "can't register RTC device\n");
308 return err;
309 }
310
311 rtcdrv->irq = platform_get_irq(pdev, 0); 311 rtcdrv->irq = platform_get_irq(pdev, 0);
312 err = devm_request_irq( 312 err = devm_request_irq(
313 &pdev->dev, 313 &pdev->dev,