/* Returns negative errno, or else the number of bytes written.  */
int i2c_master_send(struct i2c_client *client, const char *buf, int count)
/* Returns negative errno, or else the number of bytes written.  */
int i2c_master_send(struct i2c_client *client, const char *buf, int count)
{
	int ret;
	struct i2c_adapter *adap=client->adapter;
	struct i2c_msg msg;
	msg.addr = client->addr;
	msg.flags = client->flags & I2C_M_TEN;
	msg.len = count;
	msg.buf = (char *)buf;
	ret = i2c_transfer(adap, &msg, 1);
	return (ret == 1) ? count : ret;
}