diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-06-05 17:09:12 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-06-07 14:09:49 -0400 |
commit | 0b472ad2999c3dea6f9968db7c2ebe150e7eac14 (patch) | |
tree | 0fc6b2333aa4a20b268d7369d02ed6981f0da6cb /drivers/rtc | |
parent | b8e62b58bc004391c68890ab0313317cff07fb6b (diff) |
rtc: test: convert to devm_rtc_allocate_device
This allows further improvement of the driver.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-test.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 70d4ab1d2769..0c30b04326c5 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c | |||
@@ -120,15 +120,16 @@ static int test_probe(struct platform_device *plat_dev) | |||
120 | 120 | ||
121 | platform_set_drvdata(plat_dev, rtd); | 121 | platform_set_drvdata(plat_dev, rtd); |
122 | 122 | ||
123 | rtd->rtc = devm_rtc_device_register(&plat_dev->dev, "test", | 123 | rtd->rtc = devm_rtc_allocate_device(&plat_dev->dev); |
124 | &test_rtc_ops, THIS_MODULE); | ||
125 | if (IS_ERR(rtd->rtc)) | 124 | if (IS_ERR(rtd->rtc)) |
126 | return PTR_ERR(rtd->rtc); | 125 | return PTR_ERR(rtd->rtc); |
127 | 126 | ||
127 | rtd->rtc->ops = &test_rtc_ops; | ||
128 | |||
128 | timer_setup(&rtd->alarm, test_rtc_alarm_handler, 0); | 129 | timer_setup(&rtd->alarm, test_rtc_alarm_handler, 0); |
129 | rtd->alarm.expires = 0; | 130 | rtd->alarm.expires = 0; |
130 | 131 | ||
131 | return 0; | 132 | return rtc_register_device(rtd->rtc); |
132 | } | 133 | } |
133 | 134 | ||
134 | static struct platform_driver test_driver = { | 135 | static struct platform_driver test_driver = { |