common/cnxk: return saner error codes
authorTomasz Duszynski <tduszynski@marvell.com>
Mon, 26 Jul 2021 13:58:10 +0000 (08:58 -0500)
committerJerin Jacob <jerinj@marvell.com>
Tue, 28 Sep 2021 10:09:14 +0000 (12:09 +0200)
If particular LMAC does not exist then it's saner to return ENODEV
instead of EINVAL.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/cnxk/roc_bphy_cgx.c

index 9e53fe2..7449cbe 100644 (file)
@@ -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);