aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-10-12 18:05:27 -0400
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2017-10-12 18:10:14 -0400
commit3032269b21fdbfc021b14d14a50bec39f9891b08 (patch)
tree6ad30e7da72a2226574a04fd4c6c1b05d1e10ac7
parent9da32ba64d59d577297bf766a3f12753ebef5712 (diff)
rtc: ds1511: switch to rtc_register_device
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-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