hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/rtc/rtc-rs5c313.c
....@@ -366,15 +366,15 @@
366366
367367 static int rs5c313_rtc_probe(struct platform_device *pdev)
368368 {
369
- struct rtc_device *rtc = devm_rtc_device_register(&pdev->dev, "rs5c313",
370
- &rs5c313_rtc_ops, THIS_MODULE);
369
+ struct rtc_device *rtc;
371370
372
- if (IS_ERR(rtc))
373
- return PTR_ERR(rtc);
371
+ rs5c313_init_port();
372
+ rs5c313_check_xstp_bit();
374373
375
- platform_set_drvdata(pdev, rtc);
374
+ rtc = devm_rtc_device_register(&pdev->dev, "rs5c313", &rs5c313_rtc_ops,
375
+ THIS_MODULE);
376376
377
- return 0;
377
+ return PTR_ERR_OR_ZERO(rtc);
378378 }
379379
380380 static struct platform_driver rs5c313_rtc_platform_driver = {
....@@ -384,27 +384,7 @@
384384 .probe = rs5c313_rtc_probe,
385385 };
386386
387
-static int __init rs5c313_rtc_init(void)
388
-{
389
- int err;
390
-
391
- err = platform_driver_register(&rs5c313_rtc_platform_driver);
392
- if (err)
393
- return err;
394
-
395
- rs5c313_init_port();
396
- rs5c313_check_xstp_bit();
397
-
398
- return 0;
399
-}
400
-
401
-static void __exit rs5c313_rtc_exit(void)
402
-{
403
- platform_driver_unregister(&rs5c313_rtc_platform_driver);
404
-}
405
-
406
-module_init(rs5c313_rtc_init);
407
-module_exit(rs5c313_rtc_exit);
387
+module_platform_driver(rs5c313_rtc_platform_driver);
408388
409389 MODULE_AUTHOR("kogiidena , Nobuhiro Iwamatsu <iwamatsu@nigauri.org>");
410390 MODULE_DESCRIPTION("Ricoh RS5C313 RTC device driver");