]> git.baikalelectronics.ru Git - kernel.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)
committerJakub Kicinski <kuba@kernel.org>
Fri, 27 May 2022 03:45:29 +0000 (20:45 -0700)
commit93b4a698736f6e7addbb79d9ef64957ac53b7b2c
treeb16ea24c177cd635c1a628a9c2923d37e9e9914e
parent8f367d0b361ca35f616c2f0772e46f1c3dae96a4
net: lan966x: check devm_of_phy_get() for -EDEFER_PROBE

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: bb48b7a2878d ("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>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c