ENC28J60 errors reported by Max Holtzberg

This commit is contained in:
Gregory Nutt 2013-08-21 08:10:32 -06:00
parent 85aa2c1a8d
commit e5208a6e92

View File

@ -763,7 +763,7 @@ static int enc_waitbreg(FAR struct enc_driver_s *priv, uint8_t ctrlreg,
}
while ((rddata & bits) != value || elapsed > ENC_POLLTIMEOUT);
return (rddata & bits) == value ? -ETIMEDOUT : OK;
return (rddata & bits) == value ? OK : -ETIMEDOUT;
}
/****************************************************************************
@ -1007,7 +1007,7 @@ static uint16_t enc_rdphy(FAR struct enc_driver_s *priv, uint8_t phyaddr)
*/
up_udelay(12);
if (enc_waitbreg(priv, ENC_MISTAT, MISTAT_BUSY, 0x00) == OK);
if (enc_waitbreg(priv, ENC_MISTAT, MISTAT_BUSY, 0x00) == OK)
{
/* 4. Clear the MICMD.MIIRD bit. */