dt->tm_sec = BCD_TO_BIN(buf[0]); dt->tm_min = BCD_TO_BIN(buf[1]); 
dt->tm_sec = BCD2BIN(buf[0]); dt->tm_min = BCD2BIN(buf[1]); 
static int ds1337_get_datetime(struct i2c_client *client, struct rtc_time *dt){	struct ds1337_data *data = i2c_get_clientdata(client);	int result;	u8 buf[7];	u8 val;	struct i2c_msg msg[2];	u8 offs = 0;	if (!dt) {		dev_dbg(&client->adapter->dev, "%s: EINVAL: dt=NULL\n",			__FUNCTION__);		return -EINVAL;	}	msg[0].addr = client->addr;	msg[0].flags = 0;	msg[0].len = 1;	msg[0].buf = &offs;	msg[1].addr = client->addr;	msg[1].flags = I2C_M_RD;	msg[1].len = sizeof(buf);	msg[1].buf = &buf[0];	result = i2c_transfer(client->adapter, msg, 2);	dev_dbg(&client->adapter->dev,		"%s: [%d] %02x %02x %02x %02x %02x %02x %02x\n",		__FUNCTION__, result, buf[0], buf[1], buf[2], buf[3],		buf[4], buf[5], buf[6]);	if (result >= 0) {		dt->tm_sec = BCD_TO_BIN(buf[0]);		dt->tm_min = BCD_TO_BIN(buf[1]);		val = buf[2] & 0x3f;		dt->tm_hour = BCD_TO_BIN(val);		dt->tm_wday = BCD_TO_BIN(buf[3]) - 1;		dt->tm_mday = BCD_TO_BIN(buf[4]);		val = buf[5] & 0x7f;		dt->tm_mon = BCD_TO_BIN(val);		dt->tm_year = 1900 + BCD_TO_BIN(buf[6]);		if (buf[5] & 0x80)			dt->tm_year += 100;		dev_dbg(&client->adapter->dev, "%s: secs=%d, mins=%d, "			"hours=%d, mday=%d, mon=%d, year=%d, wday=%d\n",			__FUNCTION__, dt->tm_sec, dt->tm_min,			dt->tm_hour, dt->tm_mday,			dt->tm_mon, dt->tm_year, dt->tm_wday);	} else {		dev_err(&client->adapter->dev, "ds1337[%d]: error reading "			"data! %d\n", data->id, result);		result = -EIO;	}	return result;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6069ffde15472da9d041a58df490d388bb175d51/ds1337.c/clean/drivers/i2c/chips/ds1337.c