aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1511.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-ds1511.c')
-rw-r--r--drivers/rtc/rtc-ds1511.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c
index 1b2dcb58c0ab..d44635178771 100644
--- a/drivers/rtc/rtc-ds1511.c
+++ b/drivers/rtc/rtc-ds1511.c
@@ -477,11 +477,16 @@ static int ds1511_rtc_probe(struct platform_device *pdev)
477 spin_lock_init(&pdata->lock); 477 spin_lock_init(&pdata->lock);
478 platform_set_drvdata(pdev, pdata); 478 platform_set_drvdata(pdev, pdata);
479 479
480 pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, 480 pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
481 &ds1511_rtc_ops, THIS_MODULE);
482 if (IS_ERR(pdata->rtc)) 481 if (IS_ERR(pdata->rtc))
483 return PTR_ERR(pdata->rtc); 482 return PTR_ERR(pdata->rtc);
484 483
484 pdata->rtc->ops = &ds1511_rtc_ops;
485
486 ret = rtc_register_device(pdata->rtc);
487 if (ret)
488 return ret;
489
485 /* 490 /*
486 * if the platform has an interrupt in mind for this device, 491 * if the platform has an interrupt in mind for this device,
487 * then by all means, set it 492 * then by all means, set it