From fe20ba70abf7d6e5855c3dacc729490b3d0d077f Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Sat, 18 Oct 2008 20:28:41 -0700 Subject: drivers/rtc/: use bcd2bin/bin2bcd Change drivers/rtc/ to use the new bcd2bin/bin2bcd functions instead of the obsolete BCD_TO_BIN/BIN_TO_BCD/BCD2BIN/BIN2BCD macros. Signed-off-by: Adrian Bunk Acked-by: Alessandro Zummo Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-ds1302.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'drivers/rtc/rtc-ds1302.c') diff --git a/drivers/rtc/rtc-ds1302.c b/drivers/rtc/rtc-ds1302.c index b9397818f73a..16bdba6a6b0c 100644 --- a/drivers/rtc/rtc-ds1302.c +++ b/drivers/rtc/rtc-ds1302.c @@ -107,13 +107,13 @@ static int ds1302_rtc_read_time(struct device *dev, struct rtc_time *tm) spin_lock_irq(&rtc->lock); - tm->tm_sec = BCD2BIN(ds1302_readbyte(RTC_ADDR_SEC)); - tm->tm_min = BCD2BIN(ds1302_readbyte(RTC_ADDR_MIN)); - tm->tm_hour = BCD2BIN(ds1302_readbyte(RTC_ADDR_HOUR)); - tm->tm_wday = BCD2BIN(ds1302_readbyte(RTC_ADDR_DAY)); - tm->tm_mday = BCD2BIN(ds1302_readbyte(RTC_ADDR_DATE)); - tm->tm_mon = BCD2BIN(ds1302_readbyte(RTC_ADDR_MON)) - 1; - tm->tm_year = BCD2BIN(ds1302_readbyte(RTC_ADDR_YEAR)); + tm->tm_sec = bcd2bin(ds1302_readbyte(RTC_ADDR_SEC)); + tm->tm_min = bcd2bin(ds1302_readbyte(RTC_ADDR_MIN)); + tm->tm_hour = bcd2bin(ds1302_readbyte(RTC_ADDR_HOUR)); + tm->tm_wday = bcd2bin(ds1302_readbyte(RTC_ADDR_DAY)); + tm->tm_mday = bcd2bin(ds1302_readbyte(RTC_ADDR_DATE)); + tm->tm_mon = bcd2bin(ds1302_readbyte(RTC_ADDR_MON)) - 1; + tm->tm_year = bcd2bin(ds1302_readbyte(RTC_ADDR_YEAR)); if (tm->tm_year < 70) tm->tm_year += 100; @@ -141,13 +141,13 @@ static int ds1302_rtc_set_time(struct device *dev, struct rtc_time *tm) /* Stop RTC */ ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) | 0x80); - ds1302_writebyte(RTC_ADDR_SEC, BIN2BCD(tm->tm_sec)); - ds1302_writebyte(RTC_ADDR_MIN, BIN2BCD(tm->tm_min)); - ds1302_writebyte(RTC_ADDR_HOUR, BIN2BCD(tm->tm_hour)); - ds1302_writebyte(RTC_ADDR_DAY, BIN2BCD(tm->tm_wday)); - ds1302_writebyte(RTC_ADDR_DATE, BIN2BCD(tm->tm_mday)); - ds1302_writebyte(RTC_ADDR_MON, BIN2BCD(tm->tm_mon + 1)); - ds1302_writebyte(RTC_ADDR_YEAR, BIN2BCD(tm->tm_year % 100)); + ds1302_writebyte(RTC_ADDR_SEC, bin2bcd(tm->tm_sec)); + ds1302_writebyte(RTC_ADDR_MIN, bin2bcd(tm->tm_min)); + ds1302_writebyte(RTC_ADDR_HOUR, bin2bcd(tm->tm_hour)); + ds1302_writebyte(RTC_ADDR_DAY, bin2bcd(tm->tm_wday)); + ds1302_writebyte(RTC_ADDR_DATE, bin2bcd(tm->tm_mday)); + ds1302_writebyte(RTC_ADDR_MON, bin2bcd(tm->tm_mon + 1)); + ds1302_writebyte(RTC_ADDR_YEAR, bin2bcd(tm->tm_year % 100)); /* Start RTC */ ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) & ~0x80); -- cgit v1.2.2