hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/rtc/rtc-ps3.c
....@@ -1,20 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * PS3 RTC Driver
34 *
45 * Copyright 2009 Sony Corporation
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; version 2 of the License.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program.
17
- * If not, see <http://www.gnu.org/licenses/>.
186 */
197
208 #include <linux/kernel.h>
....@@ -40,16 +28,13 @@
4028
4129 static int ps3_get_time(struct device *dev, struct rtc_time *tm)
4230 {
43
- rtc_time_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm);
31
+ rtc_time64_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm);
4432 return 0;
4533 }
4634
4735 static int ps3_set_time(struct device *dev, struct rtc_time *tm)
4836 {
49
- unsigned long now;
50
-
51
- rtc_tm_to_time(tm, &now);
52
- ps3_os_area_set_rtc_diff(now - read_rtc());
37
+ ps3_os_area_set_rtc_diff(rtc_tm_to_time64(tm) - read_rtc());
5338 return 0;
5439 }
5540
....@@ -62,13 +47,16 @@
6247 {
6348 struct rtc_device *rtc;
6449
65
- rtc = devm_rtc_device_register(&dev->dev, "rtc-ps3", &ps3_rtc_ops,
66
- THIS_MODULE);
50
+ rtc = devm_rtc_allocate_device(&dev->dev);
6751 if (IS_ERR(rtc))
6852 return PTR_ERR(rtc);
6953
54
+ rtc->ops = &ps3_rtc_ops;
55
+ rtc->range_max = U64_MAX;
56
+
7057 platform_set_drvdata(dev, rtc);
71
- return 0;
58
+
59
+ return rtc_register_device(rtc);
7260 }
7361
7462 static struct platform_driver ps3_rtc_driver = {