All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device()
@ 2018-04-26  2:58 Baolin Wang
  2018-04-26  2:58 ` [PATCH 2/2] rtc: sprd: Add RTC hardware range Baolin Wang
  2018-05-03 20:12 ` [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device() Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Baolin Wang @ 2018-04-26  2:58 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni; +Cc: baolin.wang, broonie, linux-rtc, linux-kernel

This is a preparation patch, changing to use devm_rtc_allocate_device()
that can allow driver to set 'range_max' and 'range_min' for the RTC
device.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/rtc/rtc-sc27xx.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c
index 00d87d1..ac86322 100644
--- a/drivers/rtc/rtc-sc27xx.c
+++ b/drivers/rtc/rtc-sc27xx.c
@@ -600,6 +600,10 @@ static int sprd_rtc_probe(struct platform_device *pdev)
 		return rtc->irq;
 	}
 
+	rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtc->rtc))
+		return PTR_ERR(rtc->rtc);
+
 	rtc->dev = &pdev->dev;
 	platform_set_drvdata(pdev, rtc);
 
@@ -626,10 +630,12 @@ static int sprd_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-					    &sprd_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc->rtc))
-		return PTR_ERR(rtc->rtc);
+	rtc->rtc->ops = &sprd_rtc_ops;
+	ret = rtc_register_device(rtc->rtc);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to register rtc device\n");
+		return ret;
+	}
 
 	device_init_wakeup(&pdev->dev, 1);
 	return 0;
-- 
1.7.9.5

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

* [PATCH 2/2] rtc: sprd: Add RTC hardware range
  2018-04-26  2:58 [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device() Baolin Wang
@ 2018-04-26  2:58 ` Baolin Wang
  2018-05-03 20:12 ` [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device() Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Baolin Wang @ 2018-04-26  2:58 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni; +Cc: baolin.wang, broonie, linux-rtc, linux-kernel

The SC27xx RTC can support dates from 1970-01-01 00:00:00 to 2149-06-06
23:59:59.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/rtc/rtc-sc27xx.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c
index ac86322..6a3876e 100644
--- a/drivers/rtc/rtc-sc27xx.c
+++ b/drivers/rtc/rtc-sc27xx.c
@@ -631,6 +631,8 @@ static int sprd_rtc_probe(struct platform_device *pdev)
 	}
 
 	rtc->rtc->ops = &sprd_rtc_ops;
+	rtc->rtc->range_min = 0;
+	rtc->rtc->range_max = 5662310399LL;
 	ret = rtc_register_device(rtc->rtc);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register rtc device\n");
-- 
1.7.9.5

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

* Re: [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device()
  2018-04-26  2:58 [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device() Baolin Wang
  2018-04-26  2:58 ` [PATCH 2/2] rtc: sprd: Add RTC hardware range Baolin Wang
@ 2018-05-03 20:12 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2018-05-03 20:12 UTC (permalink / raw)
  To: Baolin Wang; +Cc: a.zummo, broonie, linux-rtc, linux-kernel

On 26/04/2018 10:58:44+0800, Baolin Wang wrote:
> This is a preparation patch, changing to use devm_rtc_allocate_device()
> that can allow driver to set 'range_max' and 'range_min' for the RTC
> device.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> ---
>  drivers/rtc/rtc-sc27xx.c |   14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 

Both applied, thanks.

-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-05-03 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26  2:58 [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device() Baolin Wang
2018-04-26  2:58 ` [PATCH 2/2] rtc: sprd: Add RTC hardware range Baolin Wang
2018-05-03 20:12 ` [PATCH 1/2] rtc: sprd: Change to use devm_rtc_allocate_device() Alexandre Belloni

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.