Commit 93206f93 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Alexandre Belloni

rtc: pic32: 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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 8d2e6b22
...@@ -170,9 +170,7 @@ static int pic32_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) ...@@ -170,9 +170,7 @@ static int pic32_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
rtc_tm->tm_year += 100; rtc_tm->tm_year += 100;
dev_dbg(dev, "read time %04d.%02d.%02d %02d:%02d:%02d\n", dev_dbg(dev, "read time %ptR\n", rtc_tm);
1900 + rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday,
rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec);
clk_disable(pdata->clk); clk_disable(pdata->clk);
return 0; return 0;
...@@ -184,9 +182,7 @@ static int pic32_rtc_settime(struct device *dev, struct rtc_time *tm) ...@@ -184,9 +182,7 @@ static int pic32_rtc_settime(struct device *dev, struct rtc_time *tm)
void __iomem *base = pdata->reg_base; void __iomem *base = pdata->reg_base;
int year = tm->tm_year - 100; int year = tm->tm_year - 100;
dev_dbg(dev, "set time %04d.%02d.%02d %02d:%02d:%02d\n", dev_dbg(dev, "set time %ptR\n", tm);
1900 + tm->tm_year, tm->tm_mon, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
if (year < 0 || year >= 100) { if (year < 0 || year >= 100) {
dev_err(dev, "rtc only supports 100 years\n"); dev_err(dev, "rtc only supports 100 years\n");
...@@ -224,10 +220,7 @@ static int pic32_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -224,10 +220,7 @@ static int pic32_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm)
alrm->enabled = (alm_en & PIC32_RTCALRM_ALRMEN) ? 1 : 0; alrm->enabled = (alm_en & PIC32_RTCALRM_ALRMEN) ? 1 : 0;
dev_dbg(dev, "getalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n", dev_dbg(dev, "getalarm: %d, %ptR\n", alm_en, alm_tm);
alm_en,
1900 + alm_tm->tm_year, alm_tm->tm_mon, alm_tm->tm_mday,
alm_tm->tm_hour, alm_tm->tm_min, alm_tm->tm_sec);
alm_tm->tm_sec = bcd2bin(alm_tm->tm_sec); alm_tm->tm_sec = bcd2bin(alm_tm->tm_sec);
alm_tm->tm_min = bcd2bin(alm_tm->tm_min); alm_tm->tm_min = bcd2bin(alm_tm->tm_min);
...@@ -247,10 +240,7 @@ static int pic32_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -247,10 +240,7 @@ static int pic32_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
void __iomem *base = pdata->reg_base; void __iomem *base = pdata->reg_base;
clk_enable(pdata->clk); clk_enable(pdata->clk);
dev_dbg(dev, "setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n", dev_dbg(dev, "setalarm: %d, %ptR\n", alrm->enabled, tm);
alrm->enabled,
1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
writel(0x00, base + PIC32_ALRMTIME); writel(0x00, base + PIC32_ALRMTIME);
writel(0x00, base + PIC32_ALRMDATE); writel(0x00, base + PIC32_ALRMDATE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment