* [PATCH] m68k: mvme: Remove overdue #warnings in RTC handling
@ 2021-09-07 12:45 Geert Uytterhoeven
2021-09-08 4:13 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2021-09-07 12:45 UTC (permalink / raw)
To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven
The warnings were introduced when converting the MVME147 and MVME16x
RTC handling from gettod to hwclk. Replace the #warning by a comment,
and return an error to inform the upper layer that writing to the RTC is
not yet supported.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
arch/m68k/mvme147/config.c | 4 +++-
arch/m68k/mvme16x/config.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index e1e90c49a49624cc..dfd6202fd403e92b 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -171,7 +171,6 @@ static int bcd2int (unsigned char b)
int mvme147_hwclk(int op, struct rtc_time *t)
{
-#warning check me!
if (!op) {
m147_rtc->ctrl = RTC_READ;
t->tm_year = bcd2int (m147_rtc->bcd_year);
@@ -183,6 +182,9 @@ int mvme147_hwclk(int op, struct rtc_time *t)
m147_rtc->ctrl = 0;
if (t->tm_year < 70)
t->tm_year += 100;
+ } else {
+ /* FIXME Setting the time is not yet supported */
+ return -EOPNOTSUPP;
}
return 0;
}
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index b59593c7cfb9dfbf..b4422c2dfbbf4f7c 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -436,7 +436,6 @@ int bcd2int (unsigned char b)
int mvme16x_hwclk(int op, struct rtc_time *t)
{
-#warning check me!
if (!op) {
rtc->ctrl = RTC_READ;
t->tm_year = bcd2int (rtc->bcd_year);
@@ -448,6 +447,9 @@ int mvme16x_hwclk(int op, struct rtc_time *t)
rtc->ctrl = 0;
if (t->tm_year < 70)
t->tm_year += 100;
+ } else {
+ /* FIXME Setting the time is not yet supported */
+ return -EOPNOTSUPP;
}
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] m68k: mvme: Remove overdue #warnings in RTC handling
2021-09-07 12:45 [PATCH] m68k: mvme: Remove overdue #warnings in RTC handling Geert Uytterhoeven
@ 2021-09-08 4:13 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-09-08 4:13 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-m68k, linux-kernel
On Tue, Sep 07, 2021 at 02:45:11PM +0200, Geert Uytterhoeven wrote:
> The warnings were introduced when converting the MVME147 and MVME16x
> RTC handling from gettod to hwclk. Replace the #warning by a comment,
> and return an error to inform the upper layer that writing to the RTC is
> not yet supported.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> arch/m68k/mvme147/config.c | 4 +++-
> arch/m68k/mvme16x/config.c | 4 +++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
> index e1e90c49a49624cc..dfd6202fd403e92b 100644
> --- a/arch/m68k/mvme147/config.c
> +++ b/arch/m68k/mvme147/config.c
> @@ -171,7 +171,6 @@ static int bcd2int (unsigned char b)
>
> int mvme147_hwclk(int op, struct rtc_time *t)
> {
> -#warning check me!
> if (!op) {
> m147_rtc->ctrl = RTC_READ;
> t->tm_year = bcd2int (m147_rtc->bcd_year);
> @@ -183,6 +182,9 @@ int mvme147_hwclk(int op, struct rtc_time *t)
> m147_rtc->ctrl = 0;
> if (t->tm_year < 70)
> t->tm_year += 100;
> + } else {
> + /* FIXME Setting the time is not yet supported */
> + return -EOPNOTSUPP;
> }
> return 0;
> }
> diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
> index b59593c7cfb9dfbf..b4422c2dfbbf4f7c 100644
> --- a/arch/m68k/mvme16x/config.c
> +++ b/arch/m68k/mvme16x/config.c
> @@ -436,7 +436,6 @@ int bcd2int (unsigned char b)
>
> int mvme16x_hwclk(int op, struct rtc_time *t)
> {
> -#warning check me!
> if (!op) {
> rtc->ctrl = RTC_READ;
> t->tm_year = bcd2int (rtc->bcd_year);
> @@ -448,6 +447,9 @@ int mvme16x_hwclk(int op, struct rtc_time *t)
> rtc->ctrl = 0;
> if (t->tm_year < 70)
> t->tm_year += 100;
> + } else {
> + /* FIXME Setting the time is not yet supported */
> + return -EOPNOTSUPP;
> }
> return 0;
> }
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-08 4:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 12:45 [PATCH] m68k: mvme: Remove overdue #warnings in RTC handling Geert Uytterhoeven
2021-09-08 4:13 ` Guenter Roeck
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.