diff options
author | Robert Marko <robert.marko@sartura.hr> | 2021-09-12 23:00:51 +0200 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2021-09-25 19:28:54 +0200 |
commit | 603848cad86538061c245004a39e0d5c77cc05d2 (patch) | |
tree | 457665853ccd86a171ce8af79b178f9e3d018ea1 /target/linux/ipq40xx | |
parent | 80f007fdb203022f632c4e7bb7ff78b1fde80b63 (diff) | |
download | upstream-603848cad86538061c245004a39e0d5c77cc05d2.tar.gz upstream-603848cad86538061c245004a39e0d5c77cc05d2.tar.bz2 upstream-603848cad86538061c245004a39e0d5c77cc05d2.zip |
ipq40xx: net: ethernet: edma: update of_get_phy_mode() for 5.10
In kernel v5.5 of_get_phy_mode had its API changed, so its now returning 0
or errors instead of phymode.
Phymode is now returning by passing a pointer to phy_interface_t where it
will be stored.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Diffstat (limited to 'target/linux/ipq40xx')
-rw-r--r-- | target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c index b5ca99598d..e6739261c3 100644 --- a/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c +++ b/target/linux/ipq40xx/files/drivers/net/ethernet/qualcomm/essedma/edma_axi.c @@ -23,6 +23,7 @@ #include <linux/clk.h> #include <linux/string.h> #include <linux/reset.h> +#include <linux/version.h> #include "edma.h" #include "ess_edma.h" @@ -1184,10 +1185,17 @@ static int edma_axi_probe(struct platform_device *pdev) for (i = 0; i < edma_cinfo->num_gmac; i++) { if (adapter[i]->poll_required) { - int phy_mode = of_get_phy_mode(np); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) + phy_interface_t phy_mode; + err = of_get_phy_mode(np, &phy_mode); + if (err) + phy_mode = PHY_INTERFACE_MODE_SGMII; +#else + int phy_mode = of_get_phy_mode(np); if (phy_mode < 0) phy_mode = PHY_INTERFACE_MODE_SGMII; +#endif adapter[i]->phydev = phy_connect(edma_netdev[i], (const char *)adapter[i]->phy_id, |