amd-xgbe: Support defining PHY resources in ETH device node

Simplify the device tree support of the amd-xgbe driver by defining
the PHY-related resources within the ethernet device node. The support
provides backwards compatibility with the original way.

Update the driver version to 1.0.2.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
index 0c219b3..34c521d 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -300,14 +300,21 @@
 	struct platform_device *phy_pdev;
 
 	phy_node = of_parse_phandle(dev->of_node, "phy-handle", 0);
-	if (!phy_node) {
-		dev_err(dev, "unable to locate phy device\n");
-		return NULL;
+	if (phy_node) {
+		/* Old style device tree:
+		 *   The XGBE and PHY resources are separate
+		 */
+		phy_pdev = of_find_device_by_node(phy_node);
+		of_node_put(phy_node);
+	} else {
+		/* New style device tree:
+		 *   The XGBE and PHY resources are grouped together with
+		 *   the PHY resources listed last
+		 */
+		get_device(dev);
+		phy_pdev = pdata->pdev;
 	}
 
-	phy_pdev = of_find_device_by_node(phy_node);
-	of_node_put(phy_node);
-
 	return phy_pdev;
 }
 #else   /* CONFIG_OF */
@@ -401,14 +408,14 @@
 	phy_dev = &phy_pdev->dev;
 
 	if (pdev == phy_pdev) {
-		/* ACPI:
+		/* New style device tree or ACPI:
 		 *   The XGBE and PHY resources are grouped together with
 		 *   the PHY resources listed last
 		 */
 		phy_memnum = xgbe_resource_count(pdev, IORESOURCE_MEM) - 3;
 		phy_irqnum = xgbe_resource_count(pdev, IORESOURCE_IRQ) - 1;
 	} else {
-		/* Device tree:
+		/* Old style device tree:
 		 *   The XGBE and PHY resources are separate
 		 */
 		phy_memnum = 0;