From 61598093bbdd283a7edc367d900f223070ead8d2 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 10 May 2024 07:43:03 +0000 Subject: [PATCH] add ax88772C AX88772C_eeprom_tools --- kernel/drivers/rtc/rtc-ps3.c | 30 +++++++++--------------------- 1 files changed, 9 insertions(+), 21 deletions(-) diff --git a/kernel/drivers/rtc/rtc-ps3.c b/kernel/drivers/rtc/rtc-ps3.c index 347288b..f0336d6 100644 --- a/kernel/drivers/rtc/rtc-ps3.c +++ b/kernel/drivers/rtc/rtc-ps3.c @@ -1,20 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /* * PS3 RTC Driver * * Copyright 2009 Sony Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. - * If not, see <http://www.gnu.org/licenses/>. */ #include <linux/kernel.h> @@ -40,16 +28,13 @@ static int ps3_get_time(struct device *dev, struct rtc_time *tm) { - rtc_time_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm); + rtc_time64_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm); return 0; } static int ps3_set_time(struct device *dev, struct rtc_time *tm) { - unsigned long now; - - rtc_tm_to_time(tm, &now); - ps3_os_area_set_rtc_diff(now - read_rtc()); + ps3_os_area_set_rtc_diff(rtc_tm_to_time64(tm) - read_rtc()); return 0; } @@ -62,13 +47,16 @@ { struct rtc_device *rtc; - rtc = devm_rtc_device_register(&dev->dev, "rtc-ps3", &ps3_rtc_ops, - THIS_MODULE); + rtc = devm_rtc_allocate_device(&dev->dev); if (IS_ERR(rtc)) return PTR_ERR(rtc); + rtc->ops = &ps3_rtc_ops; + rtc->range_max = U64_MAX; + platform_set_drvdata(dev, rtc); - return 0; + + return rtc_register_device(rtc); } static struct platform_driver ps3_rtc_driver = { -- Gitblit v1.6.2