From b816b6f44851102963e792ecbbe54fa6f12fd49c Mon Sep 17 00:00:00 2001 From: Tomasz Duszynski Date: Mon, 26 Jul 2021 08:58:10 -0500 Subject: [PATCH] common/cnxk: return saner error codes If particular LMAC does not exist then it's saner to return ENODEV instead of EINVAL. Signed-off-by: Tomasz Duszynski Acked-by: Jerin Jacob --- drivers/common/cnxk/roc_bphy_cgx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.20.1