diff options
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/lantiq_gswip.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c index a514e6c78c38..de48b194048f 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -510,11 +510,11 @@ static int gswip_mdio(struct gswip_priv *priv) struct device_node *mdio_np, *switch_np = priv->dev->of_node; struct device *dev = priv->dev; struct mii_bus *bus; - int err; + int err = 0; mdio_np = of_get_compatible_child(switch_np, "lantiq,xrx200-mdio"); - if (!mdio_np) - return 0; + if (!of_device_is_available(mdio_np)) + goto out_put_node; bus = devm_mdiobus_alloc(dev); if (!bus) { |