aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-07-11 17:02:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-11 19:04:44 -0400
commitad49fcbe9083f42321adfdd217ed2e0037fd739f (patch)
tree410269311c5aed013b58f2f3b837a133e6a85cd5 /drivers/rtc
parent3cfd16a551dc0c188160e1765168a04baf2d3198 (diff)
drivers/rtc/rtc-ab8500.c: ensure correct probing of the AB8500 RTC when Device Tree is enabled
Without this patch, if Device Tree is enabled the AB8500 RTC wouldn't get probed at all, as there is no reference to it from platform code. This patch ensures the driver is probed during normal DT start-up. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Lee Jones <lee.jones@linaro.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Acked-by: Linus Walleij <linus.walleij@linaro.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-ab8500.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index b11a2ecef3ff..370889d0489b 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -17,6 +17,7 @@
17#include <linux/mfd/abx500.h> 17#include <linux/mfd/abx500.h>
18#include <linux/mfd/abx500/ab8500.h> 18#include <linux/mfd/abx500/ab8500.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/of.h>
20 21
21#define AB8500_RTC_SOFF_STAT_REG 0x00 22#define AB8500_RTC_SOFF_STAT_REG 0x00
22#define AB8500_RTC_CC_CONF_REG 0x01 23#define AB8500_RTC_CC_CONF_REG 0x01
@@ -430,7 +431,6 @@ static int __devinit ab8500_rtc_probe(struct platform_device *pdev)
430 431
431 platform_set_drvdata(pdev, rtc); 432 platform_set_drvdata(pdev, rtc);
432 433
433
434 err = ab8500_sysfs_rtc_register(&pdev->dev); 434 err = ab8500_sysfs_rtc_register(&pdev->dev);
435 if (err) { 435 if (err) {
436 dev_err(&pdev->dev, "sysfs RTC failed to register\n"); 436 dev_err(&pdev->dev, "sysfs RTC failed to register\n");
@@ -454,10 +454,16 @@ static int __devexit ab8500_rtc_remove(struct platform_device *pdev)
454 return 0; 454 return 0;
455} 455}
456 456
457static const struct of_device_id ab8500_rtc_match[] = {
458 { .compatible = "stericsson,ab8500-rtc", },
459 {}
460};
461
457static struct platform_driver ab8500_rtc_driver = { 462static struct platform_driver ab8500_rtc_driver = {
458 .driver = { 463 .driver = {
459 .name = "ab8500-rtc", 464 .name = "ab8500-rtc",
460 .owner = THIS_MODULE, 465 .owner = THIS_MODULE,
466 .of_match_table = ab8500_rtc_match,
461 }, 467 },
462 .probe = ab8500_rtc_probe, 468 .probe = ab8500_rtc_probe,
463 .remove = __devexit_p(ab8500_rtc_remove), 469 .remove = __devexit_p(ab8500_rtc_remove),