···4747static DEFINE_IDR(i2c_adapter_idr);48484949static struct device_type i2c_client_type;5050-static int i2c_check_addr(struct i2c_adapter *adapter, int addr);5150static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver);52515352/* ------------------------------------------------------------------------- */···407408 return 0;408409}409410411411+static int __i2c_check_addr_busy(struct device *dev, void *addrp)412412+{413413+ struct i2c_client *client = i2c_verify_client(dev);414414+ int addr = *(int *)addrp;415415+416416+ if (client && client->addr == addr)417417+ return -EBUSY;418418+ return 0;419419+}420420+421421+static int i2c_check_addr_busy(struct i2c_adapter *adapter, int addr)422422+{423423+ return device_for_each_child(&adapter->dev, &addr,424424+ __i2c_check_addr_busy);425425+}426426+410427/**411428 * i2c_new_device - instantiate an i2c device412429 * @adap: the adapter managing the device···471456 }472457473458 /* Check for address business */474474- status = i2c_check_addr(adap, client->addr);459459+ status = i2c_check_addr_busy(adap, client->addr);475460 if (status)476461 goto out_err;477462···1079106410801065/* ------------------------------------------------------------------------- */1081106610821082-static int __i2c_check_addr(struct device *dev, void *addrp)10831083-{10841084- struct i2c_client *client = i2c_verify_client(dev);10851085- int addr = *(int *)addrp;10861086-10871087- if (client && client->addr == addr)10881088- return -EBUSY;10891089- return 0;10901090-}10911091-10921092-static int i2c_check_addr(struct i2c_adapter *adapter, int addr)10931093-{10941094- return device_for_each_child(&adapter->dev, &addr, __i2c_check_addr);10951095-}10961096-10971067/**10981068 * i2c_use_client - increments the reference count of the i2c client structure10991069 * @client: the client being referenced···13691369 }1370137013711371 /* Skip if already in use */13721372- if (i2c_check_addr(adapter, addr))13721372+ if (i2c_check_addr_busy(adapter, addr))13731373 return 0;1374137413751375 /* Make sure there is something at this address */···14751475 }1476147614771477 /* Check address availability */14781478- if (i2c_check_addr(adap, addr_list[i])) {14781478+ if (i2c_check_addr_busy(adap, addr_list[i])) {14791479 dev_dbg(&adap->dev, "Address 0x%02x already in "14801480 "use, not probing\n", addr_list[i]);14811481 continue;