rtc: m48t59: Switch to use %ptR

Use %ptR instead of open coded variant to print content of
struct rtc_time in human readable format.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Andy Shevchenko 2018-12-04 23:23:16 +02:00 committed by Alexandre Belloni
parent 22b844ae33
commit ad78343e40
1 changed files with 2 additions and 6 deletions

View File

@ -99,9 +99,7 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)
M48T59_CLEAR_BITS(M48T59_CNTL_READ, M48T59_CNTL); M48T59_CLEAR_BITS(M48T59_CNTL_READ, M48T59_CNTL);
spin_unlock_irqrestore(&m48t59->lock, flags); spin_unlock_irqrestore(&m48t59->lock, flags);
dev_dbg(dev, "RTC read time %04d-%02d-%02d %02d/%02d/%02d\n", dev_dbg(dev, "RTC read time %ptR\n", tm);
tm->tm_year + 1900, tm->tm_mon, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
return 0; return 0;
} }
@ -188,9 +186,7 @@ static int m48t59_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
M48T59_CLEAR_BITS(M48T59_CNTL_READ, M48T59_CNTL); M48T59_CLEAR_BITS(M48T59_CNTL_READ, M48T59_CNTL);
spin_unlock_irqrestore(&m48t59->lock, flags); spin_unlock_irqrestore(&m48t59->lock, flags);
dev_dbg(dev, "RTC read alarm time %04d-%02d-%02d %02d/%02d/%02d\n", dev_dbg(dev, "RTC read alarm time %ptR\n", tm);
tm->tm_year + 1900, tm->tm_mon, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
return rtc_valid_tm(tm); return rtc_valid_tm(tm);
} }