diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-10-18 23:28:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-20 11:52:41 -0400 |
commit | fe20ba70abf7d6e5855c3dacc729490b3d0d077f (patch) | |
tree | 918619427cc051d22cb38b44e94c7e65f29ee928 /drivers/rtc/rtc-r9701.c | |
parent | 4110a0d6206bd175419cc5503f80cc296d184cbf (diff) |
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-r9701.c')
-rw-r--r-- | drivers/rtc/rtc-r9701.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c index 395985b339c9..42028f233bef 100644 --- a/drivers/rtc/rtc-r9701.c +++ b/drivers/rtc/rtc-r9701.c | |||
@@ -80,13 +80,13 @@ static int r9701_get_datetime(struct device *dev, struct rtc_time *dt) | |||
80 | 80 | ||
81 | memset(dt, 0, sizeof(*dt)); | 81 | memset(dt, 0, sizeof(*dt)); |
82 | 82 | ||
83 | dt->tm_sec = BCD2BIN(buf[0]); /* RSECCNT */ | 83 | dt->tm_sec = bcd2bin(buf[0]); /* RSECCNT */ |
84 | dt->tm_min = BCD2BIN(buf[1]); /* RMINCNT */ | 84 | dt->tm_min = bcd2bin(buf[1]); /* RMINCNT */ |
85 | dt->tm_hour = BCD2BIN(buf[2]); /* RHRCNT */ | 85 | dt->tm_hour = bcd2bin(buf[2]); /* RHRCNT */ |
86 | 86 | ||
87 | dt->tm_mday = BCD2BIN(buf[3]); /* RDAYCNT */ | 87 | dt->tm_mday = bcd2bin(buf[3]); /* RDAYCNT */ |
88 | dt->tm_mon = BCD2BIN(buf[4]) - 1; /* RMONCNT */ | 88 | dt->tm_mon = bcd2bin(buf[4]) - 1; /* RMONCNT */ |
89 | dt->tm_year = BCD2BIN(buf[5]) + 100; /* RYRCNT */ | 89 | dt->tm_year = bcd2bin(buf[5]) + 100; /* RYRCNT */ |
90 | 90 | ||
91 | /* the rtc device may contain illegal values on power up | 91 | /* the rtc device may contain illegal values on power up |
92 | * according to the data sheet. make sure they are valid. | 92 | * according to the data sheet. make sure they are valid. |
@@ -103,12 +103,12 @@ static int r9701_set_datetime(struct device *dev, struct rtc_time *dt) | |||
103 | if (year >= 2100 || year < 2000) | 103 | if (year >= 2100 || year < 2000) |
104 | return -EINVAL; | 104 | return -EINVAL; |
105 | 105 | ||
106 | ret = write_reg(dev, RHRCNT, BIN2BCD(dt->tm_hour)); | 106 | ret = write_reg(dev, RHRCNT, bin2bcd(dt->tm_hour)); |
107 | ret = ret ? ret : write_reg(dev, RMINCNT, BIN2BCD(dt->tm_min)); | 107 | ret = ret ? ret : write_reg(dev, RMINCNT, bin2bcd(dt->tm_min)); |
108 | ret = ret ? ret : write_reg(dev, RSECCNT, BIN2BCD(dt->tm_sec)); | 108 | ret = ret ? ret : write_reg(dev, RSECCNT, bin2bcd(dt->tm_sec)); |
109 | ret = ret ? ret : write_reg(dev, RDAYCNT, BIN2BCD(dt->tm_mday)); | 109 | ret = ret ? ret : write_reg(dev, RDAYCNT, bin2bcd(dt->tm_mday)); |
110 | ret = ret ? ret : write_reg(dev, RMONCNT, BIN2BCD(dt->tm_mon + 1)); | 110 | ret = ret ? ret : write_reg(dev, RMONCNT, bin2bcd(dt->tm_mon + 1)); |
111 | ret = ret ? ret : write_reg(dev, RYRCNT, BIN2BCD(dt->tm_year - 100)); | 111 | ret = ret ? ret : write_reg(dev, RYRCNT, bin2bcd(dt->tm_year - 100)); |
112 | ret = ret ? ret : write_reg(dev, RWKCNT, 1 << dt->tm_wday); | 112 | ret = ret ? ret : write_reg(dev, RWKCNT, 1 << dt->tm_wday); |
113 | 113 | ||
114 | return ret; | 114 | return ret; |