From: Jingoo Han Date: Tue, 26 Mar 2013 23:25:37 +0000 (+1100) Subject: rtc: rtc-ls1x: use devm_rtc_device_register() X-Git-Tag: next-20130404~3^2~185 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1a04c81e8f92f3f92c808cba02f33636291e7b57;p=karo-tx-linux.git rtc: rtc-ls1x: use devm_rtc_device_register() devm_rtc_device_register() is device managed and makes cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Andrew Morton --- diff --git a/drivers/rtc/rtc-ls1x.c b/drivers/rtc/rtc-ls1x.c index f59b6349551a..db82f91f4562 100644 --- a/drivers/rtc/rtc-ls1x.c +++ b/drivers/rtc/rtc-ls1x.c @@ -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;