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-pcf8583.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-pcf8583.c')
-rw-r--r-- | drivers/rtc/rtc-pcf8583.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c index d388c662bf4b..7d33cda3f8f6 100644 --- a/drivers/rtc/rtc-pcf8583.c +++ b/drivers/rtc/rtc-pcf8583.c | |||
@@ -76,11 +76,11 @@ static int pcf8583_get_datetime(struct i2c_client *client, struct rtc_time *dt) | |||
76 | buf[4] &= 0x3f; | 76 | buf[4] &= 0x3f; |
77 | buf[5] &= 0x1f; | 77 | buf[5] &= 0x1f; |
78 | 78 | ||
79 | dt->tm_sec = BCD2BIN(buf[1]); | 79 | dt->tm_sec = bcd2bin(buf[1]); |
80 | dt->tm_min = BCD2BIN(buf[2]); | 80 | dt->tm_min = bcd2bin(buf[2]); |
81 | dt->tm_hour = BCD2BIN(buf[3]); | 81 | dt->tm_hour = bcd2bin(buf[3]); |
82 | dt->tm_mday = BCD2BIN(buf[4]); | 82 | dt->tm_mday = bcd2bin(buf[4]); |
83 | dt->tm_mon = BCD2BIN(buf[5]) - 1; | 83 | dt->tm_mon = bcd2bin(buf[5]) - 1; |
84 | } | 84 | } |
85 | 85 | ||
86 | return ret == 2 ? 0 : -EIO; | 86 | return ret == 2 ? 0 : -EIO; |
@@ -94,14 +94,14 @@ static int pcf8583_set_datetime(struct i2c_client *client, struct rtc_time *dt, | |||
94 | buf[0] = 0; | 94 | buf[0] = 0; |
95 | buf[1] = get_ctrl(client) | 0x80; | 95 | buf[1] = get_ctrl(client) | 0x80; |
96 | buf[2] = 0; | 96 | buf[2] = 0; |
97 | buf[3] = BIN2BCD(dt->tm_sec); | 97 | buf[3] = bin2bcd(dt->tm_sec); |
98 | buf[4] = BIN2BCD(dt->tm_min); | 98 | buf[4] = bin2bcd(dt->tm_min); |
99 | buf[5] = BIN2BCD(dt->tm_hour); | 99 | buf[5] = bin2bcd(dt->tm_hour); |
100 | 100 | ||
101 | if (datetoo) { | 101 | if (datetoo) { |
102 | len = 8; | 102 | len = 8; |
103 | buf[6] = BIN2BCD(dt->tm_mday) | (dt->tm_year << 6); | 103 | buf[6] = bin2bcd(dt->tm_mday) | (dt->tm_year << 6); |
104 | buf[7] = BIN2BCD(dt->tm_mon + 1) | (dt->tm_wday << 5); | 104 | buf[7] = bin2bcd(dt->tm_mon + 1) | (dt->tm_wday << 5); |
105 | } | 105 | } |
106 | 106 | ||
107 | ret = i2c_master_send(client, (char *)buf, len); | 107 | ret = i2c_master_send(client, (char *)buf, len); |