* [PATCH 1/2] rtc: s3c: stop setting bogus time
@ 2021-02-02 11:29 Alexandre Belloni
2021-02-02 11:29 ` [PATCH 2/2] rtc: s3c: quiet maybe-unused variable warning Alexandre Belloni
2021-02-02 12:05 ` [PATCH 1/2] rtc: s3c: stop setting bogus time Krzysztof Kozlowski
0 siblings, 2 replies; 4+ messages in thread
From: Alexandre Belloni @ 2021-02-02 11:29 UTC (permalink / raw)
To: linux-rtc, Marek Szyprowski, Alessandro Zummo, Alexandre Belloni
Cc: linux-kernel, Krzysztof Kozlowski
It doesn't make sense to set the RTC to a default value at probe time. Let
the core handle invalid date and time.
Also, this is basically dead code since commit 22652ba72453 ("rtc: stop
validating rtc_time in .read_time")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-s3c.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index fab326ba9cec..f07b0c43aafe 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -382,7 +382,6 @@ static int s3c_rtc_remove(struct platform_device *pdev)
static int s3c_rtc_probe(struct platform_device *pdev)
{
struct s3c_rtc *info = NULL;
- struct rtc_time rtc_tm;
int ret;
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -448,20 +447,6 @@ static int s3c_rtc_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 1);
- /* Check RTC Time */
- if (s3c_rtc_gettime(&pdev->dev, &rtc_tm)) {
- rtc_tm.tm_year = 100;
- rtc_tm.tm_mon = 0;
- rtc_tm.tm_mday = 1;
- rtc_tm.tm_hour = 0;
- rtc_tm.tm_min = 0;
- rtc_tm.tm_sec = 0;
-
- s3c_rtc_settime(&pdev->dev, &rtc_tm);
-
- dev_warn(&pdev->dev, "warning: invalid RTC value so initializing it\n");
- }
-
/* register RTC and exit */
info->rtc = devm_rtc_device_register(&pdev->dev, "s3c", &s3c_rtcops,
THIS_MODULE);
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] rtc: s3c: quiet maybe-unused variable warning
2021-02-02 11:29 [PATCH 1/2] rtc: s3c: stop setting bogus time Alexandre Belloni
@ 2021-02-02 11:29 ` Alexandre Belloni
2021-02-02 12:06 ` Krzysztof Kozlowski
2021-02-02 12:05 ` [PATCH 1/2] rtc: s3c: stop setting bogus time Krzysztof Kozlowski
1 sibling, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2021-02-02 11:29 UTC (permalink / raw)
To: linux-rtc, Marek Szyprowski, Alessandro Zummo, Alexandre Belloni
Cc: linux-kernel, Krzysztof Kozlowski
When CONFIG_OF is disabled then the matching table is not referenced.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-s3c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index f07b0c43aafe..e57d3ca70a78 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -558,7 +558,7 @@ static struct s3c_rtc_data const s3c6410_rtc_data = {
.disable = s3c6410_rtc_disable,
};
-static const struct of_device_id s3c_rtc_dt_match[] = {
+static const __maybe_unused struct of_device_id s3c_rtc_dt_match[] = {
{
.compatible = "samsung,s3c2410-rtc",
.data = &s3c2410_rtc_data,
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] rtc: s3c: stop setting bogus time
2021-02-02 11:29 [PATCH 1/2] rtc: s3c: stop setting bogus time Alexandre Belloni
2021-02-02 11:29 ` [PATCH 2/2] rtc: s3c: quiet maybe-unused variable warning Alexandre Belloni
@ 2021-02-02 12:05 ` Krzysztof Kozlowski
1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-02-02 12:05 UTC (permalink / raw)
To: Alexandre Belloni
Cc: linux-rtc, Marek Szyprowski, Alessandro Zummo, linux-kernel
On Tue, Feb 02, 2021 at 12:29:33PM +0100, Alexandre Belloni wrote:
> It doesn't make sense to set the RTC to a default value at probe time. Let
> the core handle invalid date and time.
>
> Also, this is basically dead code since commit 22652ba72453 ("rtc: stop
> validating rtc_time in .read_time")
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
> drivers/rtc/rtc-s3c.c | 15 ---------------
> 1 file changed, 15 deletions(-)
>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] rtc: s3c: quiet maybe-unused variable warning
2021-02-02 11:29 ` [PATCH 2/2] rtc: s3c: quiet maybe-unused variable warning Alexandre Belloni
@ 2021-02-02 12:06 ` Krzysztof Kozlowski
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-02-02 12:06 UTC (permalink / raw)
To: Alexandre Belloni
Cc: linux-rtc, Marek Szyprowski, Alessandro Zummo, linux-kernel
On Tue, Feb 02, 2021 at 12:29:34PM +0100, Alexandre Belloni wrote:
> When CONFIG_OF is disabled then the matching table is not referenced.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
> drivers/rtc/rtc-s3c.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-02 12:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 11:29 [PATCH 1/2] rtc: s3c: stop setting bogus time Alexandre Belloni
2021-02-02 11:29 ` [PATCH 2/2] rtc: s3c: quiet maybe-unused variable warning Alexandre Belloni
2021-02-02 12:06 ` Krzysztof Kozlowski
2021-02-02 12:05 ` [PATCH 1/2] rtc: s3c: stop setting bogus time Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).