diff options
author | Arun Ramadoss <arun.ramadoss@microchip.com> | 2022-09-22 12:40:25 +0530 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-09-26 12:41:07 -0700 |
commit | 68ccceaef0b46935e805f4c1cfd20b6af0e6fc77 (patch) | |
tree | 783fbcfdb6805736e2dfbac1f604c20c8d1472fa /drivers/net/dsa/microchip | |
parent | abc1cb8cbd7376a2f856e64986ee5ce0849d974b (diff) | |
download | linux-68ccceaef0b46935e805f4c1cfd20b6af0e6fc77.tar.bz2 |
net: dsa: microchip: lan937x: return zero if mdio node not present
Currently, if the mdio node is not present in the dts file then
lan937x_mdio_register return -ENODEV and entire probing process fails.
To make the mdio_register generic for all ksz series switches and to
maintain back-compatibility with existing dts file, return -ENODEV is
replaced with return 0.
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/microchip')
-rw-r--r-- | drivers/net/dsa/microchip/lan937x_main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c index c25ac439a927..06964c8a14a4 100644 --- a/drivers/net/dsa/microchip/lan937x_main.c +++ b/drivers/net/dsa/microchip/lan937x_main.c @@ -214,10 +214,8 @@ static int lan937x_mdio_register(struct ksz_device *dev) int ret; mdio_np = of_get_child_by_name(dev->dev->of_node, "mdio"); - if (!mdio_np) { - dev_err(ds->dev, "no MDIO bus node\n"); - return -ENODEV; - } + if (!mdio_np) + return 0; bus = devm_mdiobus_alloc(ds->dev); if (!bus) { |