/* Return: 0 if the link status is OK, -ve if a error occurred during checking  */
static int check_link_status(struct udevice *dev, u8 lane_count)
/* Return: 0 if the link status is OK, -ve if a error occurred during checking  */
static int check_link_status(struct udevice *dev, u8 lane_count)
{
	u8 retry_count = 0;
	if (!is_connected(dev))
		return -ENODEV;
	do {
		int status;
		status = get_lane_status_adj_reqs(dev);
		if (status)
			return -EIO;
		if ((check_clock_recovery(dev, lane_count) == 0) &&
		    (check_channel_equalization(dev, lane_count) == 0))
			return 0;
		retry_count++;
	} while (retry_count < 5);
	return -EIO;
}