/* This routine supports chips which consume multiple I2C addresses. It computes the addressing information to be used for a given r/w request. Assumes that sanity checks for offset happened at sysfs-layer.  */
static struct i2c_client* at24_translate_offset(struct at24_data *at24, unsigned *offset)
/* This routine supports chips which consume multiple I2C addresses. It computes the addressing information to be used for a given r/w request. Assumes that sanity checks for offset happened at sysfs-layer.  */
static struct i2c_client* at24_translate_offset(struct at24_data *at24, unsigned *offset)
{
	unsigned i;
	if (at24->chip.flags & AT24_FLAG_ADDR16) {
		i = *offset >> 16;
		*offset &= 0xffff;
	} else {
		i = *offset >> 8;
		*offset &= 0xff;
	}
	return at24->client[i];
}