rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64
Alexandre Belloni
maintainerPATCH 1/3 rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion as the hypervisor handles 64bit values.
--- drivers/rtc/rtc-sun4v.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/rtc/rtc-sun4v.c +2 -9
@@ -39,7 +39,7 @@ static unsigned long hypervisor_get_time(void)static int sun4v_read_time (struct device *dev,struct rtc_time *tm) { -rtc_time_to_tm (hypervisor_get_time (), tm); +rtc_time64_to_tm (hypervisor_get_time (), tm);return 0 ; }
@@ -66,14 +66,7 @@ static int hypervisor_set_time(unsigned long secs)static int sun4v_set_time (struct device *dev,struct rtc_time *tm) { -unsigned long secs; -int err; - - err =rtc_tm_to_time (tm, &secs); -if (err) -return err; - -return hypervisor_set_time (secs); +return hypervisor_set_time (rtc_tm_to_time64 (tm)); }static const struct rtc_class_ops sun4v_rtc_ops = {
Signature · 1 line
2.20.1
Alexandre Belloni
maintainerPATCH 2/3 rtc: sun4v: set range
The Sun4v Hypervisor Core API Specification states:
Time is described by a single unsigned 64-bit word equivalent to a time_t for the POSIX time(2) system call. The word contains the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds.
--- drivers/rtc/rtc-sun4v.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/rtc/rtc-sun4v.c +5 -3
@@ -78,13 +78,15 @@ static int __init sun4v_rtc_probe(struct platform_device *pdev) {struct rtc_device *rtc; - rtc =devm_rtc_device_register (&pdev->dev,"sun4v" , - &sun4v_rtc_ops,THIS_MODULE ); + rtc =devm_rtc_allocate_device (&pdev->dev);if (IS_ERR (rtc))return PTR_ERR (rtc); + rtc->ops = &sun4v_rtc_ops; + rtc->range_max =U64_MAX ;platform_set_drvdata (pdev, rtc); -return 0 ; + +return rtc_register_device (rtc); }static struct platform_driver sun4v_rtc_driver = {
Signature · 1 line
2.20.1
Re: [PATCH 2/3] rtc: sun4v: set range
From: Alexandre Belloni <[email protected]>
Date: Fri, 22 Mar 2019 08:22:55 +0100
Quoted 6 lines
The Sun4v Hypervisor Core API Specification states:
Time is described by a single unsigned 64-bit word equivalent to atime_tfor the POSIX time(2) system call. The word contains the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds.Signed-off-by Alexandre Belloni <[email protected]>
Alexandre Belloni
maintainerPATCH 3/3 rtc: sun4v: switch to SPDX identifier
In reply to Alexandre BelloniUse SPDX-License-Identifier to be clearer on the license. Choose the v2 only as this is the default Linux license.
--- drivers/rtc/rtc-sun4v.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-sun4v.c +1 -1
@@ -1,7 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 /* rtc-sun4v.c: Hypervisor based RTC for SUN4V systems. * * Author: David S. Miller -* License: GPL * * Copyright (C) 2008 David S. Miller <[email protected]> */
Signature · 1 line
2.20.1
Re: [PATCH 3/3] rtc: sun4v: switch to SPDX identifier
From: Alexandre Belloni <[email protected]>
Date: Fri, 22 Mar 2019 08:22:56 +0100
Quoted 4 lines
Use SPDX-License-Identifier to be clearer on the license. Choose the v2 only as this is the default Linux license.
Signed-off-by Alexandre Belloni <[email protected]>
From: Alexandre Belloni <[email protected]>
Date: Fri, 22 Mar 2019 08:22:54 +0100
Quoted 4 lines
Call the 64bit versions of
rtc_tmtime conversion as the hypervisor handles 64bit values.Signed-off-by Alexandre Belloni <[email protected]>