History

drivers/rtc/rtc-s3c.c: correct debug messages

RTC-S3C used to print out debug messages incorrectly. This patch corrects incorrect outputs. (undecoded bcd numbers, incorrectly decoded register values) This patch affects the pr-debug messages only.

MyungJoo Ham committed 15 years ago

Commit 4e8896c1 parent 1424e211 file · +6 −6Browse files

Unified · Split

drivers/rtc/rtc-s3c.c+6−6
@@ -152,10 +152,6 @@ static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) · 151 unmodified lines
152152 goto retry_get_time;
153153 }
154154
155− pr_debug("read time %04d.%02d.%02d %02d:%02d:%02d\n",
156− 1900 + rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday,
157− rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec);
158−
159155 rtc_tm->tm_sec = bcd2bin(rtc_tm->tm_sec);
160156 rtc_tm->tm_min = bcd2bin(rtc_tm->tm_min);
161157 rtc_tm->tm_hour = bcd2bin(rtc_tm->tm_hour);
@@ -164,6 +160,11 @@ static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) · 2 unmodified lines
164160 rtc_tm->tm_year = bcd2bin(rtc_tm->tm_year);
165161
166162 rtc_tm->tm_year += 100;
163+
164+ pr_debug("read time %04d.%02d.%02d %02d:%02d:%02d\n",
165+ 1900 + rtc_tm->tm_year, rtc_tm->tm_mon, rtc_tm->tm_mday,
166+ rtc_tm->tm_hour, rtc_tm->tm_min, rtc_tm->tm_sec);
167+
167168 rtc_tm->tm_mon -= 1;
168169
169170 clk_disable(rtc_clk);
@@ -269,10 +270,9 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) · 99 unmodified lines
269270 clk_enable(rtc_clk);
270271 pr_debug("s3c_rtc_setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n",
271272 alrm->enabled,
272− 1900 + tm->tm_year, tm->tm_mon, tm->tm_mday,
273+ 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
273274 tm->tm_hour, tm->tm_min, tm->tm_sec);
274275
275−
276276 alrm_en = readb(base + S3C2410_RTCALM) & S3C2410_RTCALM_ALMEN;
277277 writeb(0x00, base + S3C2410_RTCALM);
278278