Commit 45e39861 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

rtc: rtc-starfire: 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 7c1385b0
......@@ -39,8 +39,10 @@ static const struct rtc_class_ops starfire_rtc_ops = {
static int __init starfire_rtc_probe(struct platform_device *pdev)
{
struct rtc_device *rtc = rtc_device_register("starfire", &pdev->dev,
&starfire_rtc_ops, THIS_MODULE);
struct rtc_device *rtc;
rtc = devm_rtc_device_register(&pdev->dev, "starfire",
&starfire_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
......@@ -51,10 +53,6 @@ static int __init starfire_rtc_probe(struct platform_device *pdev)
static int __exit starfire_rtc_remove(struct platform_device *pdev)
{
struct rtc_device *rtc = platform_get_drvdata(pdev);
rtc_device_unregister(rtc);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment