Merge tag 'pci-v4.8-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[cascardo/linux.git] / drivers / net / ethernet / apm / xgene / xgene_enet_hw.c
index 7714b7d..18bb955 100644 (file)
@@ -772,6 +772,7 @@ int xgene_enet_phy_connect(struct net_device *ndev)
 
                phy_dev = of_phy_connect(ndev, np, &xgene_enet_adjust_link,
                                         0, pdata->phy_mode);
+               of_node_put(np);
                if (!phy_dev) {
                        netdev_err(ndev, "Could not connect to PHY\n");
                        return -ENODEV;
@@ -792,6 +793,8 @@ int xgene_enet_phy_connect(struct net_device *ndev)
                        netdev_err(ndev, "Could not connect to PHY\n");
                        return  -ENODEV;
                }
+#else
+               return -ENODEV;
 #endif
        }