hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/rtc/rtc-sun4v.c
....@@ -1,7 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /* rtc-sun4v.c: Hypervisor based RTC for SUN4V systems.
23 *
34 * Author: David S. Miller
4
- * License: GPL
55 *
66 * Copyright (C) 2008 David S. Miller <davem@davemloft.net>
77 */
....@@ -39,7 +39,7 @@
3939
4040 static int sun4v_read_time(struct device *dev, struct rtc_time *tm)
4141 {
42
- rtc_time_to_tm(hypervisor_get_time(), tm);
42
+ rtc_time64_to_tm(hypervisor_get_time(), tm);
4343 return 0;
4444 }
4545
....@@ -66,14 +66,7 @@
6666
6767 static int sun4v_set_time(struct device *dev, struct rtc_time *tm)
6868 {
69
- unsigned long secs;
70
- int err;
71
-
72
- err = rtc_tm_to_time(tm, &secs);
73
- if (err)
74
- return err;
75
-
76
- return hypervisor_set_time(secs);
69
+ return hypervisor_set_time(rtc_tm_to_time64(tm));
7770 }
7871
7972 static const struct rtc_class_ops sun4v_rtc_ops = {
....@@ -85,13 +78,15 @@
8578 {
8679 struct rtc_device *rtc;
8780
88
- rtc = devm_rtc_device_register(&pdev->dev, "sun4v",
89
- &sun4v_rtc_ops, THIS_MODULE);
81
+ rtc = devm_rtc_allocate_device(&pdev->dev);
9082 if (IS_ERR(rtc))
9183 return PTR_ERR(rtc);
9284
85
+ rtc->ops = &sun4v_rtc_ops;
86
+ rtc->range_max = U64_MAX;
9387 platform_set_drvdata(pdev, rtc);
94
- return 0;
88
+
89
+ return rtc_register_device(rtc);
9590 }
9691
9792 static struct platform_driver sun4v_rtc_driver = {