summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rtc/rtc-twl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
index 3614874..8a04044 100644
--- a/drivers/rtc/rtc-twl.c
+++ b/drivers/rtc/rtc-twl.c
@@ -481,6 +481,12 @@ static int twl_rtc_probe(struct platform_device *pdev)
if (irq <= 0)
goto out1;
+ /* Initialize the register map */
+ if (twl_class_is_4030())
+ rtc_reg_map = (u8 *)twl4030_rtc_reg_map;
+ else
+ rtc_reg_map = (u8 *)twl6030_rtc_reg_map;
+
ret = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG);
if (ret < 0)
goto out1;
@@ -622,11 +628,6 @@ static struct platform_driver twl4030rtc_driver = {
static int __init twl_rtc_init(void)
{
- if (twl_class_is_4030())
- rtc_reg_map = (u8 *) twl4030_rtc_reg_map;
- else
- rtc_reg_map = (u8 *) twl6030_rtc_reg_map;
-
return platform_driver_register(&twl4030rtc_driver);
}
module_init(twl_rtc_init);
OpenPOWER on IntegriCloud