@@ -410,13 +410,6 @@ static int dryice_rtc_probe(struct platform_device *pdev)
* Initialize dryice hardware
*/
- /* put dryice into valid state */
- if (__raw_readl(imxdi->ioaddr + DSR) & DSR_NVF) {
- rc = di_write_wait(imxdi, DSR_NVF | DSR_SVF, DSR);
- if (rc)
- goto err;
- }
-
/* mask all interrupts */
__raw_writel(0, imxdi->ioaddr + DIER);
@@ -427,6 +420,13 @@ static int dryice_rtc_probe(struct platform_device *pdev)
goto err;
}
+ /* put dryice into valid state */
+ if (__raw_readl(imxdi->ioaddr + DSR) & DSR_NVF) {
+ rc = di_write_wait(imxdi, DSR_NVF | DSR_SVF, DSR);
+ if (rc)
+ goto err;
+ }
+
/* initialize alarm */
rc = di_write_wait(imxdi, DCAMR_UNSET, DCAMR);
if (rc)
Make sure to call di_write_wait() only after request_irq(), since di_write_wait() enables interrupts. Signed-off-by: Baruch Siach <baruch@tkos.co.il> --- drivers/rtc/rtc-imxdi.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)