summaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/mcdi_phy.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-04-28 11:27:14 +0200
committerDavid S. Miller <davem@davemloft.net>2010-04-28 21:44:32 +0200
commit00bbb4a5344a5f81cf5d48e781e5c0df3e588d17 (patch)
treeff144f1182235a0194d16904f39861cc923944db /drivers/net/sfc/mcdi_phy.c
parentsfc: Ignore parity errors in the other port's SRAM (diff)
downloadlinux-00bbb4a5344a5f81cf5d48e781e5c0df3e588d17.tar.xz
linux-00bbb4a5344a5f81cf5d48e781e5c0df3e588d17.zip
sfc: Consistently report short MCDI responses as EIO
In some cases failing functions were returning 0 which is obviously wrong. In other cases they were returning inappropriate error codes. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/mcdi_phy.c')
-rw-r--r--drivers/net/sfc/mcdi_phy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/sfc/mcdi_phy.c b/drivers/net/sfc/mcdi_phy.c
index 2f2354696663..5d344874f294 100644
--- a/drivers/net/sfc/mcdi_phy.c
+++ b/drivers/net/sfc/mcdi_phy.c
@@ -48,7 +48,7 @@ efx_mcdi_get_phy_cfg(struct efx_nic *efx, struct efx_mcdi_phy_cfg *cfg)
goto fail;
if (outlen < MC_CMD_GET_PHY_CFG_OUT_LEN) {
- rc = -EMSGSIZE;
+ rc = -EIO;
goto fail;
}
@@ -111,7 +111,7 @@ static int efx_mcdi_loopback_modes(struct efx_nic *efx, u64 *loopback_modes)
goto fail;
if (outlen < MC_CMD_GET_LOOPBACK_MODES_OUT_LEN) {
- rc = -EMSGSIZE;
+ rc = -EIO;
goto fail;
}
@@ -587,7 +587,7 @@ static int efx_mcdi_phy_test_alive(struct efx_nic *efx)
return rc;
if (outlen < MC_CMD_GET_PHY_STATE_OUT_LEN)
- return -EMSGSIZE;
+ return -EIO;
if (MCDI_DWORD(outbuf, GET_PHY_STATE_STATE) != MC_CMD_PHY_STATE_OK)
return -EINVAL;