Commit 0ea9a0e7877489bdd50c3556eaf89aab79190072

Authored by Jingoo Han
Committed by Linus Torvalds
1 parent 9f421f8db0

rtc: rtc-ds1302: use devm_rtc_device_register()

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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 4 deletions Side-by-side Diff

drivers/rtc/rtc-ds1302.c
... ... @@ -224,7 +224,7 @@
224 224 return -ENODEV;
225 225 }
226 226  
227   - rtc = rtc_device_register("ds1302", &pdev->dev,
  227 + rtc = devm_rtc_device_register(&pdev->dev, "ds1302",
228 228 &ds1302_rtc_ops, THIS_MODULE);
229 229 if (IS_ERR(rtc))
230 230 return PTR_ERR(rtc);
... ... @@ -236,9 +236,6 @@
236 236  
237 237 static int __exit ds1302_rtc_remove(struct platform_device *pdev)
238 238 {
239   - struct rtc_device *rtc = platform_get_drvdata(pdev);
240   -
241   - rtc_device_unregister(rtc);
242 239 platform_set_drvdata(pdev, NULL);
243 240  
244 241 return 0;