X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Frtc%2Frtc-pcf8583.c;h=7d33cda3f8f6cc5f00331635cc86ca32ddd62283;hb=b1cd2ee3b95f1c3108c68c82342c614e58ce1f13;hp=d388c662bf4b6b630909187a9fbc5370e3c97c7f;hpb=f68ec0c24755e5cdb779be6240925f2175311d84;p=linux-2.6-omap-h63xx.git diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c index d388c662bf4..7d33cda3f8f 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) buf[4] &= 0x3f; buf[5] &= 0x1f; - dt->tm_sec = BCD2BIN(buf[1]); - dt->tm_min = BCD2BIN(buf[2]); - dt->tm_hour = BCD2BIN(buf[3]); - dt->tm_mday = BCD2BIN(buf[4]); - dt->tm_mon = BCD2BIN(buf[5]) - 1; + dt->tm_sec = bcd2bin(buf[1]); + dt->tm_min = bcd2bin(buf[2]); + dt->tm_hour = bcd2bin(buf[3]); + dt->tm_mday = bcd2bin(buf[4]); + dt->tm_mon = bcd2bin(buf[5]) - 1; } return ret == 2 ? 0 : -EIO; @@ -94,14 +94,14 @@ static int pcf8583_set_datetime(struct i2c_client *client, struct rtc_time *dt, buf[0] = 0; buf[1] = get_ctrl(client) | 0x80; buf[2] = 0; - buf[3] = BIN2BCD(dt->tm_sec); - buf[4] = BIN2BCD(dt->tm_min); - buf[5] = BIN2BCD(dt->tm_hour); + buf[3] = bin2bcd(dt->tm_sec); + buf[4] = bin2bcd(dt->tm_min); + buf[5] = bin2bcd(dt->tm_hour); if (datetoo) { len = 8; - buf[6] = BIN2BCD(dt->tm_mday) | (dt->tm_year << 6); - buf[7] = BIN2BCD(dt->tm_mon + 1) | (dt->tm_wday << 5); + buf[6] = bin2bcd(dt->tm_mday) | (dt->tm_year << 6); + buf[7] = bin2bcd(dt->tm_mon + 1) | (dt->tm_wday << 5); } ret = i2c_master_send(client, (char *)buf, len);