All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64
@ 2019-03-22  7:22 Alexandre Belloni
  2019-03-22  7:22 ` [PATCH 2/3] rtc: sun4v: set range Alexandre Belloni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexandre Belloni @ 2019-03-22  7:22 UTC (permalink / raw)
  To: linux-rtc, David S . Miller; +Cc: linux-kernel, Alexandre Belloni

Call the 64bit versions of rtc_tm time conversion as the hypervisor handles
64bit values.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-sun4v.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/rtc/rtc-sun4v.c b/drivers/rtc/rtc-sun4v.c
index 11bc562eba5d..378081fffa91 100644
--- a/drivers/rtc/rtc-sun4v.c
+++ b/drivers/rtc/rtc-sun4v.c
@@ -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 = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] rtc: sun4v: set range
  2019-03-22  7:22 [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
@ 2019-03-22  7:22 ` Alexandre Belloni
  2019-03-24  1:34   ` David Miller
  2019-03-22  7:22 ` [PATCH 3/3] rtc: sun4v: switch to SPDX identifier Alexandre Belloni
  2019-03-24  1:34 ` [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64 David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Alexandre Belloni @ 2019-03-22  7:22 UTC (permalink / raw)
  To: linux-rtc, David S . Miller; +Cc: linux-kernel, Alexandre Belloni

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.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-sun4v.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-sun4v.c b/drivers/rtc/rtc-sun4v.c
index 378081fffa91..82fb51f79c6e 100644
--- a/drivers/rtc/rtc-sun4v.c
+++ b/drivers/rtc/rtc-sun4v.c
@@ -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 = {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] rtc: sun4v: switch to SPDX identifier
  2019-03-22  7:22 [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
  2019-03-22  7:22 ` [PATCH 2/3] rtc: sun4v: set range Alexandre Belloni
@ 2019-03-22  7:22 ` Alexandre Belloni
  2019-03-24  1:34   ` David Miller
  2019-03-24  1:34 ` [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64 David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Alexandre Belloni @ 2019-03-22  7:22 UTC (permalink / raw)
  To: linux-rtc, David S . Miller; +Cc: linux-kernel, Alexandre Belloni

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 <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-sun4v.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-sun4v.c b/drivers/rtc/rtc-sun4v.c
index 82fb51f79c6e..036463dfa103 100644
--- a/drivers/rtc/rtc-sun4v.c
+++ b/drivers/rtc/rtc-sun4v.c
@@ -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 <davem@davemloft.net>
  */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64
  2019-03-22  7:22 [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
  2019-03-22  7:22 ` [PATCH 2/3] rtc: sun4v: set range Alexandre Belloni
  2019-03-22  7:22 ` [PATCH 3/3] rtc: sun4v: switch to SPDX identifier Alexandre Belloni
@ 2019-03-24  1:34 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-03-24  1:34 UTC (permalink / raw)
  To: alexandre.belloni; +Cc: linux-rtc, linux-kernel

From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: Fri, 22 Mar 2019 08:22:54 +0100

> Call the 64bit versions of rtc_tm time conversion as the hypervisor handles
> 64bit values.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] rtc: sun4v: set range
  2019-03-22  7:22 ` [PATCH 2/3] rtc: sun4v: set range Alexandre Belloni
@ 2019-03-24  1:34   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-03-24  1:34 UTC (permalink / raw)
  To: alexandre.belloni; +Cc: linux-rtc, linux-kernel

From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: Fri, 22 Mar 2019 08:22:55 +0100

> 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.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 3/3] rtc: sun4v: switch to SPDX identifier
  2019-03-22  7:22 ` [PATCH 3/3] rtc: sun4v: switch to SPDX identifier Alexandre Belloni
@ 2019-03-24  1:34   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-03-24  1:34 UTC (permalink / raw)
  To: alexandre.belloni; +Cc: linux-rtc, linux-kernel

From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: Fri, 22 Mar 2019 08:22:56 +0100

> 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 <alexandre.belloni@bootlin.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-03-24  1:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22  7:22 [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
2019-03-22  7:22 ` [PATCH 2/3] rtc: sun4v: set range Alexandre Belloni
2019-03-24  1:34   ` David Miller
2019-03-22  7:22 ` [PATCH 3/3] rtc: sun4v: switch to SPDX identifier Alexandre Belloni
2019-03-24  1:34   ` David Miller
2019-03-24  1:34 ` [PATCH 1/3] rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.