]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: microchip: lan937x: return zero if mdio node not present
authorArun Ramadoss <arun.ramadoss@microchip.com>
Thu, 22 Sep 2022 07:10:25 +0000 (12:40 +0530)
committerJakub Kicinski <kuba@kernel.org>
Mon, 26 Sep 2022 19:41:07 +0000 (12:41 -0700)
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>
drivers/net/dsa/microchip/lan937x_main.c

index c25ac439a9278a70b55d2a1e0cbb7d6569752570..06964c8a14a4f34428ce38a92596cf33e6be3a91 100644 (file)
@@ -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) {