diff options
author | Igor Opaniuk <igor.opaniuk@toradex.com> | 2020-11-13 14:11:10 +0200 |
---|---|---|
committer | Igor Opaniuk <igor.opaniuk@toradex.com> | 2020-11-13 14:17:32 +0200 |
commit | 3b59d4725be760cd276094079b4fbe7bd44e1464 (patch) | |
tree | 37a4892c12efe64a69453ecdb694866dd18dc4f5 /drivers/phy/marvell/phy-mvebu-a3700-comphy.c | |
parent | 4d47b797d6bb1db34ddf702f2cf78104be135a8f (diff) | |
parent | 70d1232fdbe28e4c765c4cfc3cc5c7580959d5e0 (diff) |
Merge commit '70d1232fdbe28e4c765c4cfc3cc5c7580959d5e0' into toradex_5.4-2.1.x-imx
Update 5.4-2.1.x-imx to v5.4.74 from [1].
[1] https://github.com/Freescale/linux-fslc
Diffstat (limited to 'drivers/phy/marvell/phy-mvebu-a3700-comphy.c')
-rw-r--r-- | drivers/phy/marvell/phy-mvebu-a3700-comphy.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c index 1a138be8bd6a..810f25a47632 100644 --- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c +++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c @@ -26,7 +26,6 @@ #define COMPHY_SIP_POWER_ON 0x82000001 #define COMPHY_SIP_POWER_OFF 0x82000002 #define COMPHY_SIP_PLL_LOCK 0x82000003 -#define COMPHY_FW_NOT_SUPPORTED (-1) #define COMPHY_FW_MODE_SATA 0x1 #define COMPHY_FW_MODE_SGMII 0x2 @@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane, unsigned long mode) { struct arm_smccc_res res; + s32 ret; arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res); + ret = res.a0; - return res.a0; + switch (ret) { + case SMCCC_RET_SUCCESS: + return 0; + case SMCCC_RET_NOT_SUPPORTED: + return -EOPNOTSUPP; + default: + return -EINVAL; + } } static int mvebu_a3700_comphy_get_fw_mode(int lane, int port, @@ -220,7 +228,7 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy) } ret = mvebu_a3700_comphy_smc(COMPHY_SIP_POWER_ON, lane->id, fw_param); - if (ret == COMPHY_FW_NOT_SUPPORTED) + if (ret == -EOPNOTSUPP) dev_err(lane->dev, "unsupported SMC call, try updating your firmware\n"); |