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-v3020.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-v3020.c')
-rw-r--r-- | drivers/rtc/rtc-v3020.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c index 10025d840268..14d4f036a768 100644 --- a/drivers/rtc/rtc-v3020.c +++ b/drivers/rtc/rtc-v3020.c @@ -92,19 +92,19 @@ static int v3020_read_time(struct device *dev, struct rtc_time *dt) /* ...and then read constant values. */ tmp = v3020_get_reg(chip, V3020_SECONDS); - dt->tm_sec = BCD2BIN(tmp); + dt->tm_sec = bcd2bin(tmp); tmp = v3020_get_reg(chip, V3020_MINUTES); - dt->tm_min = BCD2BIN(tmp); + dt->tm_min = bcd2bin(tmp); tmp = v3020_get_reg(chip, V3020_HOURS); - dt->tm_hour = BCD2BIN(tmp); + dt->tm_hour = bcd2bin(tmp); tmp = v3020_get_reg(chip, V3020_MONTH_DAY); - dt->tm_mday = BCD2BIN(tmp); + dt->tm_mday = bcd2bin(tmp); tmp = v3020_get_reg(chip, V3020_MONTH); - dt->tm_mon = BCD2BIN(tmp) - 1; + dt->tm_mon = bcd2bin(tmp) - 1; tmp = v3020_get_reg(chip, V3020_WEEK_DAY); - dt->tm_wday = BCD2BIN(tmp); + dt->tm_wday = bcd2bin(tmp); tmp = v3020_get_reg(chip, V3020_YEAR); - dt->tm_year = BCD2BIN(tmp)+100; + dt->tm_year = bcd2bin(tmp)+100; #ifdef DEBUG printk("\n%s : Read RTC values\n",__func__); @@ -136,13 +136,13 @@ static int v3020_set_time(struct device *dev, struct rtc_time *dt) #endif /* Write all the values to ram... */ - v3020_set_reg(chip, V3020_SECONDS, BIN2BCD(dt->tm_sec)); - v3020_set_reg(chip, V3020_MINUTES, BIN2BCD(dt->tm_min)); - v3020_set_reg(chip, V3020_HOURS, BIN2BCD(dt->tm_hour)); - v3020_set_reg(chip, V3020_MONTH_DAY, BIN2BCD(dt->tm_mday)); - v3020_set_reg(chip, V3020_MONTH, BIN2BCD(dt->tm_mon + 1)); - v3020_set_reg(chip, V3020_WEEK_DAY, BIN2BCD(dt->tm_wday)); - v3020_set_reg(chip, V3020_YEAR, BIN2BCD(dt->tm_year % 100)); + v3020_set_reg(chip, V3020_SECONDS, bin2bcd(dt->tm_sec)); + v3020_set_reg(chip, V3020_MINUTES, bin2bcd(dt->tm_min)); + v3020_set_reg(chip, V3020_HOURS, bin2bcd(dt->tm_hour)); + v3020_set_reg(chip, V3020_MONTH_DAY, bin2bcd(dt->tm_mday)); + v3020_set_reg(chip, V3020_MONTH, bin2bcd(dt->tm_mon + 1)); + v3020_set_reg(chip, V3020_WEEK_DAY, bin2bcd(dt->tm_wday)); + v3020_set_reg(chip, V3020_YEAR, bin2bcd(dt->tm_year % 100)); /* ...and set the clock. */ v3020_set_reg(chip, V3020_CMD_RAM2CLOCK, 0); |