summaryrefslogtreecommitdiffstats
path: root/drivers/char/rtc.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-12-04 22:23:12 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-12-10 22:39:37 +0100
commit5548cbf7f148b9a039b19fa4697f1b9beaba2c78 (patch)
treed061de9fb7217922bb26d9c008729d26b0d6eb93 /drivers/char/rtc.c
parentlib/vsprintf: Print time and date in human readable format via %pt (diff)
downloadlinux-5548cbf7f148b9a039b19fa4697f1b9beaba2c78.tar.xz
linux-5548cbf7f148b9a039b19fa4697f1b9beaba2c78.zip
rtc: Switch to use %ptR
Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Note, we drop the validation option. This is only used in a deprecated ABI and is mostly wrong as many RTCs will still be valid after 2100. Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/char/rtc.c')
-rw-r--r--drivers/char/rtc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 4948c8bda6b1..0cde96822a87 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -1125,11 +1125,10 @@ static int rtc_proc_show(struct seq_file *seq, void *v)
* time or for Universal Standard Time (GMT). Probably local though.
*/
seq_printf(seq,
- "rtc_time\t: %02d:%02d:%02d\n"
- "rtc_date\t: %04d-%02d-%02d\n"
+ "rtc_time\t: %ptRt\n"
+ "rtc_date\t: %ptRd\n"
"rtc_epoch\t: %04lu\n",
- tm.tm_hour, tm.tm_min, tm.tm_sec,
- tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch);
+ &tm, &tm, epoch);
get_rtc_alm_time(&tm);