Commit 418ca60c authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds
Browse files

rtc: rtc-ls1x: use devm_rtc_device_register()



devm_rtc_device_register() is device managed and makes cleanup paths
simpler.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 479243b2
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ static int ls1x_rtc_probe(struct platform_device *pdev)
	while (readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TTS)
		usleep_range(1000, 3000);

	rtcdev = rtc_device_register("ls1x-rtc", &pdev->dev,
	rtcdev = devm_rtc_device_register(&pdev->dev, "ls1x-rtc",
					&ls1x_rtc_ops , THIS_MODULE);
	if (IS_ERR(rtcdev)) {
		ret = PTR_ERR(rtcdev);
@@ -187,9 +187,6 @@ err:

static int ls1x_rtc_remove(struct platform_device *pdev)
{
	struct rtc_device *rtcdev = platform_get_drvdata(pdev);

	rtc_device_unregister(rtcdev);
	platform_set_drvdata(pdev, NULL);

	return 0;