]> git.baikalelectronics.ru Git - kernel.git/commit
net: pcs: xpcs: propagate xpcs_read error to xpcs_get_state_c37_sgmii
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 20 Jul 2022 11:20:57 +0000 (14:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:03:48 +0000 (12:03 +0200)
commitc62bd4a9bd145d47f6e901261ac4b92ff7b4fc31
treed0ef8fe47c36b4066f9482f4ddb4529c3ebb4994
parent15512f4d096c97cd58915ab26da9d35bac342c87
net: pcs: xpcs: propagate xpcs_read error to xpcs_get_state_c37_sgmii

[ Upstream commit b205a7783aa346128d9f6bb0d5f35c68f4a42c71 ]

While phylink_pcs_ops :: pcs_get_state does return void, xpcs_get_state()
does check for a non-zero return code from xpcs_get_state_c37_sgmii()
and prints that as a message to the kernel log.

However, a non-zero return code from xpcs_read() is translated into
"return false" (i.e. zero as int) and the I/O error is therefore not
printed. Fix that.

Fixes: f5cf66c4e398 ("net: pcs: add C37 SGMII AN support for intel mGbE controller")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220720112057.3504398-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/pcs/pcs-xpcs.c