[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210621173028.3541424-4-mw@semihalf.com>
Date: Mon, 21 Jun 2021 19:30:25 +0200
From: Marcin Wojtas <mw@...ihalf.com>
To: linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, linux@...linux.org.uk,
jaz@...ihalf.com, gjb@...ihalf.com, upstream@...ihalf.com,
Samer.El-Haj-Mahmoud@....com, jon@...id-run.com, tn@...ihalf.com,
rjw@...ysocki.net, lenb@...nel.org, Marcin Wojtas <mw@...ihalf.com>
Subject: [net-next: PATCH v3 3/6] net/fsl: switch to fwnode_mdiobus_register
Utilize the newly added helper routine
for registering the MDIO bus via fwnode_
interface.
Signed-off-by: Marcin Wojtas <mw@...ihalf.com>
---
drivers/net/ethernet/freescale/xgmac_mdio.c | 11 ++---------
drivers/net/ethernet/freescale/Kconfig | 4 +---
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 0b68852379da..2d99edc8a647 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/acpi_mdio.h>
+#include <linux/fwnode_mdio.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mdio.h>
@@ -246,7 +246,6 @@ 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;
@@ -291,13 +290,7 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
priv->has_a011043 = device_property_read_bool(&pdev->dev,
"fsl,erratum-a011043");
- 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;
+ ret = fwnode_mdiobus_register(bus, pdev->dev.fwnode);
if (ret) {
dev_err(&pdev->dev, "cannot register MDIO bus\n");
goto err_registration;
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
index 2d1abdd58fab..92a390576b88 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -67,9 +67,7 @@ config FSL_PQ_MDIO
config FSL_XGMAC_MDIO
tristate "Freescale XGMAC MDIO"
- select PHYLIB
- depends on OF
- select OF_MDIO
+ depends on FWNODE_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)
--
2.29.0
Powered by blists - more mailing lists