memset(d, 0, sizeof(struct rtc8564_data)); 
static int rtc8564_attach(struct i2c_adapter *adap, int addr, int kind){	int ret;	struct i2c_client *new_client;	struct rtc8564_data *d;	unsigned char data[10];	unsigned char ad[1] = { 0 };	struct i2c_msg ctrl_wr[1] = {		{addr, 0, 2, data}	};	struct i2c_msg ctrl_rd[2] = {		{addr, 0, 1, ad},		{addr, I2C_M_RD, 2, data}	};	d = kmalloc(sizeof(struct rtc8564_data), GFP_KERNEL);	if (!d) {		ret = -ENOMEM;		goto done;	}	memset(d, 0, sizeof(struct rtc8564_data));	new_client = &d->client;	strlcpy(new_client->name, "RTC8564", I2C_NAME_SIZE);	i2c_set_clientdata(new_client, d);	new_client->flags = I2C_CLIENT_ALLOW_USE;	new_client->addr = addr;	new_client->adapter = adap;	new_client->driver = &rtc8564_driver;	_DBG(1, "client=%p", new_client);	/* init ctrl1 reg */	data[0] = 0;	data[1] = 0;	ret = i2c_transfer(new_client->adapter, ctrl_wr, 1);	if (ret != 1) {		printk(KERN_INFO "rtc8564: cant init ctrl1\n");		ret = -ENODEV;		goto done;	}	/* read back ctrl1 and ctrl2 */	ret = i2c_transfer(new_client->adapter, ctrl_rd, 2);	if (ret != 2) {		printk(KERN_INFO "rtc8564: cant read ctrl\n");		ret = -ENODEV;		goto done;	}	d->ctrl = data[0] | (data[1] << 8);	_DBG(1, "RTC8564_REG_CTRL1=%02x, RTC8564_REG_CTRL2=%02x",	     data[0], data[1]);	ret = i2c_attach_client(new_client);done:	if (ret) {		kfree(d);	}	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5263ebb51eb098b01caf229498c954999117e4a7/rtc8564.c/clean/drivers/i2c/chips/rtc8564.c