/* Make sure SMIBusy bit cleared before another SMI operation can take place  */
static int mv88e61xx_busychk(char *name)
/* Make sure SMIBusy bit cleared before another SMI operation can take place  */
static int mv88e61xx_busychk(char *name)
{
	u16 reg = 0;
	u32 timeout = MV88E61XX_PHY_TIMEOUT;
	do {
		RD_PHY(name, MV88E61XX_GLB2REG_DEVADR,
		       MV88E61XX_PHY_CMD, &reg);
		if (timeout-- == 0) {
			printf("SMI busy timeout\n");
			return -1;
		}
	} while (reg & 1 << 15);
	return 0;
}