dev_dbg(&adap->dev, "registered as adapter #%d\n", adap->nr);  
int i2c_add_adapter(struct i2c_adapter *adap){	int id, res = 0;	struct list_head   *item;	struct i2c_driver  *driver;	down(&core_lists);	if (idr_pre_get(&i2c_adapter_idr, GFP_KERNEL) == 0) {		res = -ENOMEM;		goto out_unlock;	}	res = idr_get_new(&i2c_adapter_idr, adap, &id);	if (res < 0) {		if (res == -EAGAIN)			res = -ENOMEM;		goto out_unlock;	}	adap->nr =  id & MAX_ID_MASK;	init_MUTEX(&adap->bus_lock);	init_MUTEX(&adap->clist_lock);	list_add_tail(&adap->list,&adapters);	INIT_LIST_HEAD(&adap->clients);	/* Add the adapter to the driver core.	 * If the parent pointer is not set up,	 * we add this adapter to the host bus.	 */	if (adap->dev.parent == NULL)		adap->dev.parent = &platform_bus;	sprintf(adap->dev.bus_id, "i2c-%d", adap->nr);	adap->dev.driver = &i2c_adapter_driver;	adap->dev.release = &i2c_adapter_dev_release;	device_register(&adap->dev);	device_create_file(&adap->dev, &dev_attr_name);	/* Add this adapter to the i2c_adapter class */	memset(&adap->class_dev, 0x00, sizeof(struct class_device));	adap->class_dev.dev = &adap->dev;	adap->class_dev.class = &i2c_adapter_class;	strlcpy(adap->class_dev.class_id, adap->dev.bus_id, BUS_ID_SIZE);	class_device_register(&adap->class_dev);	/* inform drivers of new adapters */	list_for_each(item,&drivers) {		driver = list_entry(item, struct i2c_driver, list);		if (driver->flags & I2C_DF_NOTIFY)			/* We ignore the return code; if it fails, too bad */			driver->attach_adapter(adap);	}	dev_dbg(&adap->dev, "registered as adapter #%d\n", adap->nr);out_unlock:	up(&core_lists);	return res;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b6d7b3d1b5a388b7e9af2629a9ecccedee064078/i2c-core.c/clean/drivers/i2c/i2c-core.c