list_for_each(item,&adapters) { adapter = list_entry(item, struct i2c_adapter, list); if (id == adapter->nr && try_module_get(adapter->owner)) { up(&core_lists); return adapter; } }
adapter = (struct i2c_adapter *)idr_find(&i2c_adapter_idr, id); if (adapter && !try_module_get(adapter->owner)) adapter = NULL;
struct i2c_adapter* i2c_get_adapter(int id){	struct list_head   *item;	struct i2c_adapter *adapter;		down(&core_lists);	list_for_each(item,&adapters) {		adapter = list_entry(item, struct i2c_adapter, list);		if (id == adapter->nr &&		    try_module_get(adapter->owner)) {			up(&core_lists);			return adapter;		}	}	up(&core_lists);	return NULL;}