diff mbox series

[1/6] common/cnxk: return saner error codes

Message ID 20210726135815.81201-2-tduszynski@marvell.com (mailing list archive)
State Awaiting Upstream
Delegated to: Jerin Jacob
Headers show
Series common/cnxk: sync with local codebase | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tomasz Duszynski July 26, 2021, 1:58 p.m. UTC
If particular LMAC does not exist then it's saner to return ENODEV
instead of EINVAL.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
 drivers/common/cnxk/roc_bphy_cgx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/common/cnxk/roc_bphy_cgx.c b/drivers/common/cnxk/roc_bphy_cgx.c
index 9e53fe238e..7449cbe77a 100644
--- a/drivers/common/cnxk/roc_bphy_cgx.c
+++ b/drivers/common/cnxk/roc_bphy_cgx.c
@@ -406,7 +406,7 @@  roc_bphy_cgx_fec_set(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
 		return -EINVAL;
 
 	if (!roc_bphy_cgx_lmac_exists(roc_cgx, lmac))
-		return -EINVAL;
+		return -ENODEV;
 
 	scr1 = FIELD_PREP(SCR1_ETH_CMD_ID, ETH_CMD_SET_FEC) |
 	       FIELD_PREP(SCR1_ETH_SET_FEC_ARGS, fec);
@@ -425,7 +425,7 @@  roc_bphy_cgx_fec_supported_get(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
 		return -EINVAL;
 
 	if (!roc_bphy_cgx_lmac_exists(roc_cgx, lmac))
-		return -EINVAL;
+		return -ENODEV;
 
 	scr1 = FIELD_PREP(SCR1_ETH_CMD_ID, ETH_CMD_GET_SUPPORTED_FEC);