Thread (12 messages) 12 messages, 3 authors, 2018-03-02
STALE3008d

[PATCH net-next 3/5] net: mdio-gpio: Remove non-DT probe path

From: Linus Walleij <hidden>
Date: 2018-02-25 12:54:00
Subsystem: ethernet phy library, networking drivers, the rest · Maintainers: Andrew Lunn, Heiner Kallweit, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

This driver can now only be created using the device tree.
Remove the platform data probe path and require OF_MDIO
in Kconfig.

Signed-off-by: Linus Walleij <redacted>
---
 drivers/net/phy/Kconfig     |  2 +-
 drivers/net/phy/mdio-gpio.c | 21 ++++++---------------
 2 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index bdfbabb86ee0..27efc5d6fbe2 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -92,7 +92,7 @@ config MDIO_CAVIUM
 
 config MDIO_GPIO
 	tristate "GPIO lib-based bitbanged MDIO buses"
-	depends on MDIO_BITBANG && GPIOLIB
+	depends on MDIO_BITBANG && GPIOLIB && OF_MDIO
 	---help---
 	  Supports GPIO lib-based MDIO busses.
 
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index d95bb45eb67b..96c953d086c6 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -239,16 +239,11 @@ static int mdio_gpio_probe(struct platform_device *pdev)
 	if (!bitbang)
 		return -ENOMEM;
 
-	if (pdev->dev.of_node) {
-		pdata = mdio_gpio_of_get_data(dev);
-		bus_id = of_alias_get_id(dev->of_node, "mdio-gpio");
-		if (bus_id < 0) {
-			dev_warn(dev, "failed to get alias id\n");
-			bus_id = 0;
-		}
-	} else {
-		pdata = dev_get_platdata(dev);
-		bus_id = pdev->id;
+	pdata = mdio_gpio_of_get_data(dev);
+	bus_id = of_alias_get_id(dev->of_node, "mdio-gpio");
+	if (bus_id < 0) {
+		dev_warn(dev, "failed to get alias id\n");
+		bus_id = 0;
 	}
 
 	if (!pdata)
@@ -258,11 +253,7 @@ static int mdio_gpio_probe(struct platform_device *pdev)
 	if (!new_bus)
 		return -ENODEV;
 
-	if (dev->of_node)
-		ret = of_mdiobus_register(new_bus, dev->of_node);
-	else
-		ret = mdiobus_register(new_bus);
-
+	ret = of_mdiobus_register(new_bus, dev->of_node);
 	if (ret)
 		mdio_gpio_bus_deinit(dev);
 
-- 
2.14.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help