/* There may be more than one matching device (in the case of a DevAddr conflict), but only the first one is returned.  */
struct uwb_dev* uwb_dev_get_by_devaddr(struct uwb_rc *rc, const struct uwb_dev_addr *devaddr)
/* There may be more than one matching device (in the case of a DevAddr conflict), but only the first one is returned.  */
struct uwb_dev* uwb_dev_get_by_devaddr(struct uwb_rc *rc, const struct uwb_dev_addr *devaddr)
{
	struct uwb_dev *found = NULL;
	struct uwb_beca_e *bce;
	mutex_lock(&rc->uwb_beca.mutex);
	bce = __uwb_beca_find_bydev(rc, devaddr);
	if (bce)
		found = uwb_dev_try_get(rc, bce->uwb_dev);
	mutex_unlock(&rc->uwb_beca.mutex);
	return found;
}