diff options
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/Kconfig | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/xgmac_mdio.c | 11 | ||||
-rw-r--r-- | drivers/net/ethernet/marvell/mvmdio.c | 10 |
3 files changed, 20 insertions, 5 deletions
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig index 92a390576b88..2d1abdd58fab 100644 --- a/drivers/net/ethernet/freescale/Kconfig +++ b/drivers/net/ethernet/freescale/Kconfig @@ -67,7 +67,9 @@ config FSL_PQ_MDIO config FSL_XGMAC_MDIO tristate "Freescale XGMAC MDIO" - depends on FWNODE_MDIO + select PHYLIB + depends on OF + select OF_MDIO help This driver supports the MDIO bus on the Fman 10G Ethernet MACs, and on the FMan mEMAC (which supports both Clauses 22 and 45) diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c index 2d99edc8a647..0b68852379da 100644 --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c @@ -13,7 +13,7 @@ */ #include <linux/acpi.h> -#include <linux/fwnode_mdio.h> +#include <linux/acpi_mdio.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/mdio.h> @@ -246,6 +246,7 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum) static int xgmac_mdio_probe(struct platform_device *pdev) { + struct fwnode_handle *fwnode; struct mdio_fsl_priv *priv; struct resource *res; struct mii_bus *bus; @@ -290,7 +291,13 @@ static int xgmac_mdio_probe(struct platform_device *pdev) priv->has_a011043 = device_property_read_bool(&pdev->dev, "fsl,erratum-a011043"); - ret = fwnode_mdiobus_register(bus, pdev->dev.fwnode); + fwnode = pdev->dev.fwnode; + if (is_of_node(fwnode)) + ret = of_mdiobus_register(bus, to_of_node(fwnode)); + else if (is_acpi_node(fwnode)) + ret = acpi_mdiobus_register(bus, fwnode); + else + ret = -EINVAL; if (ret) { dev_err(&pdev->dev, "cannot register MDIO bus\n"); goto err_registration; diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c index 7537ee3f6622..62a97c46fba0 100644 --- a/drivers/net/ethernet/marvell/mvmdio.c +++ b/drivers/net/ethernet/marvell/mvmdio.c @@ -18,9 +18,9 @@ */ #include <linux/acpi.h> +#include <linux/acpi_mdio.h> #include <linux/clk.h> #include <linux/delay.h> -#include <linux/fwnode_mdio.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/kernel.h> @@ -371,7 +371,13 @@ static int orion_mdio_probe(struct platform_device *pdev) goto out_mdio; } - ret = fwnode_mdiobus_register(bus, pdev->dev.fwnode); + /* For the platforms not supporting DT/ACPI fall-back + * to mdiobus_register via of_mdiobus_register. + */ + if (is_acpi_node(pdev->dev.fwnode)) + ret = acpi_mdiobus_register(bus, pdev->dev.fwnode); + else + ret = of_mdiobus_register(bus, pdev->dev.of_node); if (ret < 0) { dev_err(&pdev->dev, "Cannot register MDIO bus (%d)\n", ret); goto out_mdio; |