Skip to content

Commit

Permalink
rtc: test: convert to devm_rtc_allocate_device
Browse files Browse the repository at this point in the history
This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
  • Loading branch information
Alexandre Belloni committed Jun 7, 2018
1 parent b8e62b5 commit 0b472ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/rtc/rtc-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,16 @@ static int test_probe(struct platform_device *plat_dev)

platform_set_drvdata(plat_dev, rtd);

rtd->rtc = devm_rtc_device_register(&plat_dev->dev, "test",
&test_rtc_ops, THIS_MODULE);
rtd->rtc = devm_rtc_allocate_device(&plat_dev->dev);
if (IS_ERR(rtd->rtc))
return PTR_ERR(rtd->rtc);

rtd->rtc->ops = &test_rtc_ops;

timer_setup(&rtd->alarm, test_rtc_alarm_handler, 0);
rtd->alarm.expires = 0;

return 0;
return rtc_register_device(rtd->rtc);
}

static struct platform_driver test_driver = {
Expand Down

0 comments on commit 0b472ad

Please sign in to comment.