lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 25 Feb 2018 13:51:30 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S . Miller" <davem@...emloft.net>
Cc:     netdev@...r.kernel.org,
        Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH net-next 3/5] net: mdio-gpio: Remove non-DT probe path

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 <linus.walleij@...aro.org>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ