]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: lan966x: check devm_of_phy_get() for -EDEFER_PROBE
authorMichael Walle <michael@walle.cc>
Wed, 25 May 2022 23:12:39 +0000 (01:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:41:21 +0000 (18:41 +0200)
commit73337dd9fbf33c84c9180e90498fa1d89fab1292
tree7370d6651771cf9910cb14da5598cf21091cb73d
parentb0808b7a04157b3f56e919f27023fec37a075fad
net: lan966x: check devm_of_phy_get() for -EDEFER_PROBE

[ Upstream commit b58cdd4388b1d8f5bee9f5a3897a7e780d1eaa48 ]

At the moment, if devm_of_phy_get() returns an error the serdes
simply isn't set. While it is bad to ignore an error in general, there
is a particular bug that network isn't working if the serdes driver is
compiled as a module. In that case, devm_of_phy_get() returns
-EDEFER_PROBE and the error is silently ignored.

The serdes is optional, it is not there if the port is using RGMII, in
which case devm_of_phy_get() returns -ENODEV. Rearrange the error
handling so that -ENODEV will be handled but other error codes will
abort the probing.

Fixes: d28d6d2e37d1 ("net: lan966x: add port module support")
Signed-off-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220525231239.1307298-1-michael@walle.cc
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c