diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-02-12 17:47:39 -0500 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-03-01 04:49:26 -0500 |
commit | affb842b84a27d12ab7fd0a86cefda0a343f0941 (patch) | |
tree | 210a4b696c2015173f3e7ba3e8d0596650bb44a9 | |
parent | d7501f709410f6813e84ecd5a28e7dc8f47ff792 (diff) |
rtc: m48t59: switch to rtc_register_device
This allows for future improvement of the driver.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | drivers/rtc/rtc-m48t59.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c index d99a705bec07..e248e56ff8a1 100644 --- a/drivers/rtc/rtc-m48t59.c +++ b/drivers/rtc/rtc-m48t59.c | |||
@@ -480,11 +480,16 @@ static int m48t59_rtc_probe(struct platform_device *pdev) | |||
480 | spin_lock_init(&m48t59->lock); | 480 | spin_lock_init(&m48t59->lock); |
481 | platform_set_drvdata(pdev, m48t59); | 481 | platform_set_drvdata(pdev, m48t59); |
482 | 482 | ||
483 | m48t59->rtc = devm_rtc_device_register(&pdev->dev, name, ops, | 483 | m48t59->rtc = devm_rtc_allocate_device(&pdev->dev); |
484 | THIS_MODULE); | ||
485 | if (IS_ERR(m48t59->rtc)) | 484 | if (IS_ERR(m48t59->rtc)) |
486 | return PTR_ERR(m48t59->rtc); | 485 | return PTR_ERR(m48t59->rtc); |
487 | 486 | ||
487 | m48t59->rtc->ops = ops; | ||
488 | |||
489 | ret = rtc_register_device(m48t59->rtc); | ||
490 | if (ret) | ||
491 | return ret; | ||
492 | |||
488 | m48t59_nvram_attr.size = pdata->offset; | 493 | m48t59_nvram_attr.size = pdata->offset; |
489 | 494 | ||
490 | ret = sysfs_create_bin_file(&pdev->dev.kobj, &m48t59_nvram_attr); | 495 | ret = sysfs_create_bin_file(&pdev->dev.kobj, &m48t59_nvram_attr); |