diff options
author | David Bauer <mail@david-bauer.net> | 2021-02-16 22:51:18 +0100 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2021-02-16 22:53:10 +0100 |
commit | a24df045db87875e914bbefa4ead2af868e92eeb (patch) | |
tree | 60c2d5958c2fece0092c509a256489b946b87f8e /target/linux/generic/files/drivers/net | |
parent | b10d6044599d8c1fa7fbb2374bcbf30118d39db1 (diff) | |
download | upstream-a24df045db87875e914bbefa4ead2af868e92eeb.tar.gz upstream-a24df045db87875e914bbefa4ead2af868e92eeb.tar.bz2 upstream-a24df045db87875e914bbefa4ead2af868e92eeb.zip |
generic: ar8216: fix kernel 5.10 compile error
Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target/linux/generic/files/drivers/net')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index acfa0ebecd..d48a415d50 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -891,7 +891,11 @@ ar8216_phy_write(struct ar8xxx_priv *priv, int addr, int regnum, u16 val) static int ar8229_hw_init(struct ar8xxx_priv *priv) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) + phy_interface_t phy_if_mode; +#else int phy_if_mode; +#endif if (priv->initialized) return 0; @@ -899,7 +903,11 @@ ar8229_hw_init(struct ar8xxx_priv *priv) ar8xxx_write(priv, AR8216_REG_CTRL, AR8216_CTRL_RESET); ar8xxx_reg_wait(priv, AR8216_REG_CTRL, AR8216_CTRL_RESET, 0, 1000); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) + of_get_phy_mode(priv->pdev->of_node, &phy_if_mode); +#else phy_if_mode = of_get_phy_mode(priv->pdev->of_node); +#endif if (phy_if_mode == PHY_INTERFACE_MODE_GMII) { ar8xxx_write(priv, AR8229_REG_OPER_MODE0, |