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

rtc: rtc-sun4v: 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 45e39861
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -81,7 +81,9 @@ static const struct rtc_class_ops sun4v_rtc_ops = {

static int __init sun4v_rtc_probe(struct platform_device *pdev)
{
	struct rtc_device *rtc = rtc_device_register("sun4v", &pdev->dev,
	struct rtc_device *rtc;

	rtc = devm_rtc_device_register(&pdev->dev, "sun4v",
				&sun4v_rtc_ops, THIS_MODULE);
	if (IS_ERR(rtc))
		return PTR_ERR(rtc);
@@ -92,9 +94,6 @@ static int __init sun4v_rtc_probe(struct platform_device *pdev)

static int __exit sun4v_rtc_remove(struct platform_device *pdev)
{
	struct rtc_device *rtc = platform_get_drvdata(pdev);

	rtc_device_unregister(rtc);
	return 0;
}