diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-10-19 07:28:41 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 19:52:41 +0400 |
commit | fe20ba70abf7d6e5855c3dacc729490b3d0d077f (patch) | |
tree | 918619427cc051d22cb38b44e94c7e65f29ee928 /drivers/rtc/rtc-m41t94.c | |
parent | 4110a0d6206bd175419cc5503f80cc296d184cbf (diff) | |
download | linux-fe20ba70abf7d6e5855c3dacc729490b3d0d077f.tar.xz |
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 <bunk@kernel.org>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-m41t94.c')
-rw-r--r-- | drivers/rtc/rtc-m41t94.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/rtc/rtc-m41t94.c b/drivers/rtc/rtc-m41t94.c index 9b19499c829e..c3a18c58daf6 100644 --- a/drivers/rtc/rtc-m41t94.c +++ b/drivers/rtc/rtc-m41t94.c @@ -41,17 +41,17 @@ static int m41t94_set_time(struct device *dev, struct rtc_time *tm) tm->tm_mon, tm->tm_year, tm->tm_wday); buf[0] = 0x80 | M41T94_REG_SECONDS; /* write time + date */ - buf[M41T94_REG_SECONDS] = BIN2BCD(tm->tm_sec); - buf[M41T94_REG_MINUTES] = BIN2BCD(tm->tm_min); - buf[M41T94_REG_HOURS] = BIN2BCD(tm->tm_hour); - buf[M41T94_REG_WDAY] = BIN2BCD(tm->tm_wday + 1); - buf[M41T94_REG_DAY] = BIN2BCD(tm->tm_mday); - buf[M41T94_REG_MONTH] = BIN2BCD(tm->tm_mon + 1); + buf[M41T94_REG_SECONDS] = bin2bcd(tm->tm_sec); + buf[M41T94_REG_MINUTES] = bin2bcd(tm->tm_min); + buf[M41T94_REG_HOURS] = bin2bcd(tm->tm_hour); + buf[M41T94_REG_WDAY] = bin2bcd(tm->tm_wday + 1); + buf[M41T94_REG_DAY] = bin2bcd(tm->tm_mday); + buf[M41T94_REG_MONTH] = bin2bcd(tm->tm_mon + 1); buf[M41T94_REG_HOURS] |= M41T94_BIT_CEB; if (tm->tm_year >= 100) buf[M41T94_REG_HOURS] |= M41T94_BIT_CB; - buf[M41T94_REG_YEAR] = BIN2BCD(tm->tm_year % 100); + buf[M41T94_REG_YEAR] = bin2bcd(tm->tm_year % 100); return spi_write(spi, buf, 8); } @@ -82,14 +82,14 @@ static int m41t94_read_time(struct device *dev, struct rtc_time *tm) spi_write(spi, buf, 2); } - tm->tm_sec = BCD2BIN(spi_w8r8(spi, M41T94_REG_SECONDS)); - tm->tm_min = BCD2BIN(spi_w8r8(spi, M41T94_REG_MINUTES)); + tm->tm_sec = bcd2bin(spi_w8r8(spi, M41T94_REG_SECONDS)); + tm->tm_min = bcd2bin(spi_w8r8(spi, M41T94_REG_MINUTES)); hour = spi_w8r8(spi, M41T94_REG_HOURS); - tm->tm_hour = BCD2BIN(hour & 0x3f); - tm->tm_wday = BCD2BIN(spi_w8r8(spi, M41T94_REG_WDAY)) - 1; - tm->tm_mday = BCD2BIN(spi_w8r8(spi, M41T94_REG_DAY)); - tm->tm_mon = BCD2BIN(spi_w8r8(spi, M41T94_REG_MONTH)) - 1; - tm->tm_year = BCD2BIN(spi_w8r8(spi, M41T94_REG_YEAR)); + tm->tm_hour = bcd2bin(hour & 0x3f); + tm->tm_wday = bcd2bin(spi_w8r8(spi, M41T94_REG_WDAY)) - 1; + tm->tm_mday = bcd2bin(spi_w8r8(spi, M41T94_REG_DAY)); + tm->tm_mon = bcd2bin(spi_w8r8(spi, M41T94_REG_MONTH)) - 1; + tm->tm_year = bcd2bin(spi_w8r8(spi, M41T94_REG_YEAR)); if ((hour & M41T94_BIT_CB) || !(hour & M41T94_BIT_CEB)) tm->tm_year += 100; |