From patchwork Sun Feb 25 12:51:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [net-next,3/5] net: mdio-gpio: Remove non-DT probe path X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 129519 Message-Id: <20180225125132.25275-4-linus.walleij@linaro.org> To: Andrew Lunn , Florian Fainelli , "David S . Miller" Cc: netdev@vger.kernel.org, Laurent Pinchart , Linus Walleij Date: Sun, 25 Feb 2018 13:51:30 +0100 From: Linus Walleij List-Id: 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 --- drivers/net/phy/Kconfig | 2 +- drivers/net/phy/mdio-gpio.c | 21 ++++++--------------- 2 files changed, 7 insertions(+), 16 deletions(-) -- 2.14.3 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);