RE: [PATCH] net: mscc: ocelot: reinterpret the return value of of_get_phy_mode

From: Woojung.Huh
Date: Mon Nov 11 2019 - 16:47:16 EST


Hi Horatiu,

> - err = of_get_phy_mode(portnp, &phy_mode);
> - if (err && err != -ENODEV)
> - goto out_put_ports;
> + phy_err = of_get_phy_mode(portnp, &phy_mode);
> + if (phy_err)
> + phy_mode = PHY_INTERFACE_MODE_NA;

Because of_get_phy_mode() would assign PHY_INTERFACE_MODE_NA to phy_mode
when error, may not need this "if (phy_err)" statement at all.

Thanks.
Woojung