Re: [PATCH net v2] net: ag71xx: fix mdio subnode support

From: David Miller
Date: Tue Oct 01 2019 - 12:03:26 EST


From: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
Date: Tue, 1 Oct 2019 08:41:47 +0200

> @@ -571,7 +571,9 @@ static int ag71xx_mdio_probe(struct ag71xx *ag)
> msleep(200);
> }
>
> - err = of_mdiobus_register(mii_bus, np);
> + mnp = of_get_child_by_name(np, "mdio");
> + err = of_mdiobus_register(mii_bus, mnp);

of_get_child_by_name() can fail, so error checking is necessary
before you pass mnp into of_mdiobus_register().