/* Used from driver probe and bus matching to check whether a RIO device matches a device id structure provided by a RIO driver. Returns the matching &struct rio_device_id or NULL if there is no match.  */
static const struct rio_device_id* rio_match_device(const struct rio_device_id *id, const struct rio_dev *rdev)
/* Used from driver probe and bus matching to check whether a RIO device matches a device id structure provided by a RIO driver. Returns the matching &struct rio_device_id or NULL if there is no match.  */
static const struct rio_device_id* rio_match_device(const struct rio_device_id *id, const struct rio_dev *rdev)
{
	while (id->vid || id->asm_vid) {
		if (((id->vid == RIO_ANY_ID) || (id->vid == rdev->vid)) &&
		    ((id->did == RIO_ANY_ID) || (id->did == rdev->did)) &&
		    ((id->asm_vid == RIO_ANY_ID)
		     || (id->asm_vid == rdev->asm_vid))
		    && ((id->asm_did == RIO_ANY_ID)
			|| (id->asm_did == rdev->asm_did)))
			return id;
		id++;
	}
	return NULL;
}