mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-02 09:18:05 +00:00
ipq40xx: edma: convert to of_mdio_find_bus()
With the reworked MDIO driver, EDMA will fail to get the MII BUS as it used the MII BUS stored inside the MDIO structure private data. This obviously does not work with the modernized driver, so lets switch to using a purpose build of_mdio_find_bus() which will return the MII BUS and only requires the MDIO node to be passed. This is easy as we already have the node parsed. Also, since we now require OF_MDIO add that as dependency. Signed-off-by: Robert Marko <robert.marko@sartura.hr>
This commit is contained in:
parent
4cdc8d20fa
commit
03bae3cafd
@ -19,6 +19,7 @@
|
|||||||
#include <linux/timer.h>
|
#include <linux/timer.h>
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/of_address.h>
|
#include <linux/of_address.h>
|
||||||
|
#include <linux/of_mdio.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
#include <linux/reset.h>
|
#include <linux/reset.h>
|
||||||
@ -713,9 +714,7 @@ static int edma_axi_probe(struct platform_device *pdev)
|
|||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
struct device_node *pnp;
|
struct device_node *pnp;
|
||||||
struct device_node *mdio_node = NULL;
|
struct device_node *mdio_node = NULL;
|
||||||
struct platform_device *mdio_plat = NULL;
|
|
||||||
struct mii_bus *miibus = NULL;
|
struct mii_bus *miibus = NULL;
|
||||||
struct edma_mdio_data *mdio_data = NULL;
|
|
||||||
int i, j, k, err = 0;
|
int i, j, k, err = 0;
|
||||||
int portid_bmp;
|
int portid_bmp;
|
||||||
int idx = 0, idx_mac = 0;
|
int idx = 0, idx_mac = 0;
|
||||||
@ -889,25 +888,9 @@ static int edma_axi_probe(struct platform_device *pdev)
|
|||||||
goto err_mdiobus_init_fail;
|
goto err_mdiobus_init_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
mdio_plat = of_find_device_by_node(mdio_node);
|
miibus = of_mdio_find_bus(mdio_node);
|
||||||
if (!mdio_plat) {
|
if (!miibus)
|
||||||
dev_err(&pdev->dev,
|
return -EINVAL;
|
||||||
"cannot find platform device from mdio node");
|
|
||||||
of_node_put(mdio_node);
|
|
||||||
err = -EIO;
|
|
||||||
goto err_mdiobus_init_fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
mdio_data = dev_get_drvdata(&mdio_plat->dev);
|
|
||||||
if (!mdio_data) {
|
|
||||||
dev_err(&pdev->dev,
|
|
||||||
"cannot get mii bus reference from device data");
|
|
||||||
of_node_put(mdio_node);
|
|
||||||
err = -EIO;
|
|
||||||
goto err_mdiobus_init_fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
miibus = mdio_data->mii_bus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (of_property_read_bool(np, "qcom,single-phy") &&
|
if (of_property_read_bool(np, "qcom,single-phy") &&
|
||||||
|
@ -11,13 +11,14 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/qualcomm/Kconfig
|
--- a/drivers/net/ethernet/qualcomm/Kconfig
|
||||||
+++ b/drivers/net/ethernet/qualcomm/Kconfig
|
+++ b/drivers/net/ethernet/qualcomm/Kconfig
|
||||||
@@ -62,4 +62,13 @@ config QCOM_EMAC
|
@@ -62,4 +62,14 @@ config QCOM_EMAC
|
||||||
|
|
||||||
source "drivers/net/ethernet/qualcomm/rmnet/Kconfig"
|
source "drivers/net/ethernet/qualcomm/rmnet/Kconfig"
|
||||||
|
|
||||||
+config ESSEDMA
|
+config ESSEDMA
|
||||||
+ tristate "Qualcomm Atheros ESS Edma support"
|
+ tristate "Qualcomm Atheros ESS Edma support"
|
||||||
+ ---help---
|
+ depends on OF_MDIO
|
||||||
|
+ help
|
||||||
+ This driver supports ethernet edma adapter.
|
+ This driver supports ethernet edma adapter.
|
||||||
+ Say Y to build this driver.
|
+ Say Y to build this driver.
|
||||||
+
|
+
|
||||||
|
Loading…
x
Reference in New Issue
Block a user